aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2020-06-07 09:14:24 -0700
committerJeff Davis <jdavis@postgresql.org>2020-06-07 09:25:55 -0700
commit1fbb6c93df30801f83c6804ab7befde3cdefe677 (patch)
tree8c136b2642614ef2e626cccdd11925293416ac35
parentaa7927698acb813283d21aa6a47a67cd3c5a8b0c (diff)
downloadpostgresql-1fbb6c93df30801f83c6804ab7befde3cdefe677.tar.gz
postgresql-1fbb6c93df30801f83c6804ab7befde3cdefe677.zip
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
-rw-r--r--src/backend/utils/sort/logtape.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/sort/logtape.c b/src/backend/utils/sort/logtape.c
index 666a7c0e81c..4984f8ce50a 100644
--- a/src/backend/utils/sort/logtape.c
+++ b/src/backend/utils/sort/logtape.c
@@ -782,7 +782,7 @@ LogicalTapeWrite(LogicalTapeSet *lts, int tapenum,
Assert(lt->buffer_size == BLCKSZ);
while (size > 0)
{
- if (lt->pos >= TapeBlockPayloadSize)
+ if (lt->pos >= (int) TapeBlockPayloadSize)
{
/* Buffer full, dump it out */
long nextBlockNumber;