Use memcmp() rather than strncmp() when shorter string length is known.
Robert Haas <rhaas@postgresql.org>
Use memcmp() rather than strncmp() when shorter string length is known. It appears that this will be faster for all but the shortest strings; at least one some platforms, memcmp() can use word-at-a-time comparisons. Noah Misch, somewhat pared down.
Files
| Path | Change | +/− |
|---|---|---|
| contrib/hstore/hstore_io.c | modified | +4 −4 |
| contrib/hstore/hstore_op.c | modified | +13 −13 |
| contrib/ltree/ltree_gist.c | modified | +1 −1 |
| contrib/ltree/ltree_op.c | modified | +4 −4 |
| src/backend/nodes/readfuncs.c | modified | +1 −1 |
| src/backend/utils/adt/varchar.c | modified | +3 −3 |
| src/backend/utils/adt/varlena.c | modified | +7 −7 |