Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Compilers > Re: parser perf...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 14 of 14 Topic 2372 of 2474
Post > Topic >>

Re: parser performance, was Popularity of compiler tools, was LRgen

by "Derek M. Jones" <derek@[EMAIL PROTECTED] > Apr 12, 2008 at 11:02 PM

Ian,

> The 50% does include tokenizing, but still parsing is more than half
> of that.  C++ files can easily include hundreds of thousands of lines
> of header files, and gcc parses all of them even though very few of
> them will be used by anything after the parsing stage.

About the only published paper on the subject is:
W. M. Waite.
The cost of lexical analysis.
Software-Practice and Experience, 16(5):473-488, 1986.

This quotes 50% of compilation time spent in tokenizing

> I should add that I agree with your main point that there probably
> isn't much speed difference between a hand-written parser and a
> generated parser.  I just want to make the point that parsing speed
> actually is relevant in practice.

Waite quotes a factor of 3-5 difference between hand written and
automatic lexers.  Perhaps the quality of automaticaly generated
lexers has improved (I have no idea)?

Given the amount of effort that has historically gone into decreasing
the size of parser tables, even to the extent of adding extra
indirection (that saved memory at the cost of longer parse times), we
might reasonably assume that parse times are not significant.

Of course now that Bison sup****ts GLR parsers (for the last few years),
there is now lots of op****tunity for people to create parsers that
consume large amounts of time and memory ;-)

> gcc now uses a hand-written parser for C too, by the way.

It has for some time.

[Re parse times, remember that yacc et al were born on systems that
gave you a total of 64K per process, so simply squeezing the compiler
into the address space was a challenge, and a few extra table lookups
was a lot better than breaking the compiler into multiple phases.  Re
automatic lexers, if he was using the old Bell Labs lex, I'm not
surprised since it was a dreadful piece of code.  (Not so dreadful as
to keep the programmer from becoming the CEO of Google, but dreadful
nonetheless.)  Flex is much faster. -John]
 




 14 Posts in Topic:
Re: Seeking recommendations for a Visual Parser to replace Visua
"Marcel Satchell&quo  2008-03-28 06:59:11 
Re: LRgen, was Seeking recommendations for a Visual Parser to re
"Paul B Mann" &  2008-03-31 02:35:38 
Re: LRgen, was Seeking recommendations for a Visual Parser to re
Hans-Peter Diettrich <  2008-04-01 10:32:26 
Popularity of compiler tools, was LRgen
anton@[EMAIL PROTECTED]   2008-04-06 15:25:04 
Re: Popularity of compiler tools, was LRgen
Jason Evans <joevans@[  2008-04-07 08:24:11 
Re: Popularity of compiler tools, was LRgen
Tegiri Nenashi <Tegiri  2008-04-08 13:13:38 
Re: Popularity of compiler tools, was LRgen
Hans-Peter Diettrich <  2008-04-11 15:57:04 
Re: Popularity of compiler tools, was LRgen
idbaxter@[EMAIL PROTECTED  2008-04-11 10:52:35 
Re: Popularity of compiler tools, was LRgen
Tegiri Nenashi <Tegiri  2008-04-11 17:00:09 
Re: Popularity of compiler tools, was LRgen
Walter Banks <walter@[  2008-04-11 09:28:14 
Re: Popularity of compiler tools, was LRgen
wclodius@[EMAIL PROTECTED  2008-04-11 22:09:16 
Re: parser performance, was Popularity of compiler tools, was LR
Ian Lance Taylor <ian@  2008-04-12 08:28:56 
Re: parser performance, was Popularity of compiler tools, was LR
Ian Lance Taylor <ian@  2008-04-12 13:06:06 
Re: parser performance, was Popularity of compiler tools, was LR
"Derek M. Jones"  2008-04-12 23:02:28 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 20:11:39 CDT 2008.