Commit 1fbb6c93 authored by Jeff Davis's avatar Jeff Davis

Fix platform-specific performance regression in logtape.c.

Commit 24d85952 made a change that indirectly caused a performance
regression by triggering a change in the way GCC optimizes memcpy() on
some platforms.

The behavior seemed to contradict a GCC document, so I filed a report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95556

This patch implements a narrow workaround which eliminates the
regression I observed. The workaround is benign enough that it seems
unlikely to cause a different regression on another platform.

Discussion: https://postgr.es/m/99b2eab335c1592c925d8143979c8e9e81e1575f.camel@j-davis.com
parent aa792769
...@@ -782,7 +782,7 @@ LogicalTapeWrite(LogicalTapeSet *lts, int tapenum, ...@@ -782,7 +782,7 @@ LogicalTapeWrite(LogicalTapeSet *lts, int tapenum,
Assert(lt->buffer_size == BLCKSZ); Assert(lt->buffer_size == BLCKSZ);
while (size > 0) while (size > 0)
{ {
if (lt->pos >= TapeBlockPayloadSize) if (lt->pos >= (int) TapeBlockPayloadSize)
{ {
/* Buffer full, dump it out */ /* Buffer full, dump it out */
long nextBlockNumber; long nextBlockNumber;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment