| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | pgsql-committers(at)postgresql(dot)org |
| Subject: | pgsql: Fix psql lexer to avoid use of backtracking. |
| Date: | 2011-08-25 18:34:55 |
| Message-ID: | E1QwelT-0007oP-36@gemulon.postgresql.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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
------
REL9_0_STABLE
Details
-------
http://git.postgresql.org/pg/commitdiff/9354f5b76acf37c96ed0173ff8ab3e415bae2b04
Modified Files
--------------
src/bin/psql/psqlscan.l | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2011-08-25 18:44:27 | pgsql: Add makefile rules to check for backtracking in backend and psql |
| Previous Message | Tom Lane | 2011-08-25 17:56:11 | pgsql: Add "%option warn" to all flex input files that lacked it. |