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

Alex Sedow alexsedow at mail.ru
Sat Nov 13 01:29:00 PST 2004


> > 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)?

No string copying. I use reference counter pointers that refers to string
(string described above).

>
> > 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?


I don't know how to attach custom string to ANTLR.

>
> 2) can you share all these classes ?

String, smart pointer - yes. But these classes very simple - every C++
programmer may write it.
Allocator (template) - no. I'm not ready to share it (but these is simple
too).

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

Sorry. My lexer/parser for C# fully hand-written.

Alex.




 
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