[antlr-interest] Antlr v4 - C++ target

A Z asicaddress at gmail.com
Wed Jan 11 17:38:26 PST 2012


The realistic minimum I see for commontoken in the existing 3.4 code is 32
bytes on a 64-bit architecture. This would involve modifications to the
code generator to no longer use the function pointers(for
setStart/setStopIndex/setType) and using a smaller data type for the
channel, factory and type members. There is still an additional 16B/token
used by the vector data structure holding the tokens.



On Wed, Jan 11, 2012 at 5:09 PM, Ruslan Zasukhin <
ruslan_zasukhin at valentina-db.com> wrote:

> On 1/11/12 11:12 AM, "Loring Craymer" <lgcraymer at yahoo.com> wrote:
>
> > If Jim did not implement the vtable indirection (that could be easily
> changed,
> > if so), then there is a little more opportunity for optimization, but
> still
> > the problem is that state information takes up much more memory than
> does the
> > text in tokens.
>
> Right,
>
> Well, lets look on antrl3commontoken.h
>
> API:
>        19   pointers to func
>                        32 bit os    19 * 4  = 76 bytes
>
> And about
>        11 * 4 bytes  of useful info
>
>
> So there is chance that in c++ style
> OR with single pointer on ala-VT  token will become
>
>    from 118 bytes to 48 bytes
>
>
>
> --
> Best regards,
>
> Ruslan Zasukhin
> VP Engineering and New Technology
> Paradigma Software, Inc
>
> Valentina - Joining Worlds of Information
> http://www.paradigmasoft.com
>
> [I feel the need: the need for speed]
>
>
>
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>


More information about the antlr-interest mailing list