Обсуждение: pgsql: Use memcmp() rather than strncmp() when shorter string length is

Поиск
Список
Период
Сортировка

pgsql: Use memcmp() rather than strncmp() when shorter string length is

От
Robert Haas
Дата:
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(-)