| From: | Robert Haas <rhaas(at)postgresql(dot)org> |
|---|---|
| To: | pgsql-committers(at)postgresql(dot)org |
| Subject: | pgsql: Use memcmp() rather than strncmp() when shorter string length is |
| Date: | 2010-12-22 03:15:37 |
| Message-ID: | E1PVFAv-0006Ho-CW@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-committers |
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.
Branch
------
master
Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=32ba2b516066688ff56e6d62a7ff4a01c88f5700
Modified Files
--------------
contrib/hstore/hstore_io.c | 8 ++++----
contrib/hstore/hstore_op.c | 26 +++++++++++++-------------
contrib/ltree/ltree_gist.c | 2 +-
contrib/ltree/ltree_op.c | 8 ++++----
src/backend/nodes/readfuncs.c | 2 +-
src/backend/utils/adt/varchar.c | 6 +++---
src/backend/utils/adt/varlena.c | 14 +++++++-------
7 files changed, 33 insertions(+), 33 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Magnus Hagander | 2010-12-22 13:25:59 | pgsql: Add PQlibVersion() function to libpq |
| Previous Message | Robert Haas | 2010-12-21 22:59:39 | pgsql: Fix typos. |