pgsql: Speedup pg_strtok() with a static lookup table
Speedup pg_strtok() with a static lookup table
This function has been known to be slow for a while and a redesign is
probably on the cards. Meanwhile, let's try to squeeze a little more
performance out of it.
Here we define a 256-byte lookup table to specify character classes and
use that in the function rather than writing long and complex
expressions to get the same thing.
A benchmark showed pg_upgrade performing about 5% faster with this
change when restoring the database schemas into the new cluster, so more
of an evolution than a revolution.
Author: David Rowley <dgrowleyml@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: David Steele <david@pgbackrest.org>
Discussion: /messages/by-id/CAApHDvo-YKLqfHfjrCFJCBxMXni83Xsfn6Nbe79CWspCHKta_Q@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/56227fd51c452624b1c08947e4ed910a8d78748e
Modified Files
--------------
src/backend/nodes/read.c | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)