pgsql: Fix psql lexer to avoid use of backtracking. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Fix psql lexer to avoid use of backtracking.
Date
Msg-id E1QwelT-0007oL-2M@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Fix psql lexer to avoid use of backtracking.

Per previous experimentation, backtracking slows down lexing performance
significantly (by about a third).  It's usually pretty easy to avoid, just
need to have rules that accept an incomplete construct and do whatever the
lexer would have done otherwise.

The backtracking was introduced by the patch that added quoted variable
substitution.  Back-patch to 9.0 where that was added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/77ce50a40364a3605f775d3f0efca2e1caa70291

Modified Files
--------------
src/bin/psql/psqlscan.l |   33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix psql lexer to avoid use of backtracking.
Next
From: Tom Lane
Date:
Subject: pgsql: Add makefile rules to check for backtracking in backend and psql