Re: scanner/parser minimization

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <stark(at)mit(dot)edu>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: scanner/parser minimization
Date: 2013-03-13 08:50:07
Message-ID: CA+U5nM+crtE5n8Eq+WSComJCWEt2ifP8oZJWX2oUDhoWcSpmiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2 March 2013 18:47, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> wrote:

>> Uh ... no. I haven't looked into why the flex tables are so large,
>> but this theory is just wrong. See ScanKeywordLookup().
>
>
> Interestingly, the yy_transition array generated by flex used to be much
> smaller:
>
> 8.3: 22072 elements
> 8.4: 62623 elements
> master: 64535 elements
>
> The big jump between 8.3 and 8.4 was caused by introduction of the unicode
> escapes: U&'foo' [UESCAPE 'x'] . And in particular, the "error rule" for the
> UESCAPE, which we use to avoid backtracking.
>
> I experimented with a patch that uses two extra flex states to shorten the
> error rules, see attached. The idea is that after lexing a unicode literal
> like "U&'foo'", you enter a new state, in which you check whether an
> "UESCAPE 'x'" follows. This slashes the size of the array to 36581 elements.

+1 to do this sooner rather than later

--
Simon Riggs http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Boszormenyi Zoltan 2013-03-13 09:31:53 Re: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]
Previous Message Albe Laurenz 2013-03-13 08:19:43 Re: Add some regression tests for SEQUENCE