[antlr-interest] BENCHMARK. ANTLR. Bad results.

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Nov 13 00:42:11 PST 2004


On 11/13/04 10:21 AM, "Alex Sedow" <alexsedow at mail.ru> wrote:

>> And I remember on this list one guy from Russia have write 5-7 tips which
> he
>> have apply to generated parser and have made it several times faster.
>> I also going to find his letter and check if this can work for us.
>> 
>> 
>> --
>> Best regards,
>> Ruslan Zasukhin      [ I feel the need...the need for speed ]
>> -------------------------------------------------------------

Hi Alex,

> Hello Ruslan!
> Thank you, for remember me.

:-)

> And thank you for confirm my conclusion - ANTLR/C++ lexer+parser 10 times
> slower than hand-written C++ lexer+parser.

But I doubt we can develop manually SQL parser.
It is huge grammar.

> Of course, ANTLR/C++ must use its own string. Because custom string may
> speed up parsing speed about 3-4 times. In my parsers I use special hash
> string class. All structures (tokens, AST nodes) contains smart pointers to
> hash strings.
> Hash string internals:
> offset, size, comment
> 0, 4, hash code <- pointers refers there
> 4, 4, reference counter
> 8, 4, string length
> 12, N, string (where N is sizeof of ASCIIZ string)

Hmm. So you also copy strings? Why not simply pointer(s)?

> This structure is variable-sized and it always aligned to 2^M size. And I
> use custom allocators for allocate/deallocate memory for this structure -
> one allocator for every 2^M size (custom allocator on synthetic tests about
> 15-60 times faster than standart MSVC new).

Yes right. Btw, our benches was on Visual.
Aslo we will make with CodeWarrior.

CodeWarrior already have built-in manager for new,
And CodeWarrior's new is much faster of Visual's.
Aha. So on CW we can expect better results.

I wonder, 

1) how you replace ANTLR's std::string with you?

2) can you share all these classes ?

3) so in release you use PATCHED ANTLR parser ?
    or you have re-write all by hands? :-)


-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
    antlr-interest-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the antlr-interest mailing list