From: | Hans Aberg <haberg@matematik.su.se> |
Newsgroups: | comp.compilers |
Date: | 28 Jun 2004 20:05:38 -0400 |
Organization: | Compilers Central |
Keywords: | parse, performance |
Posted-Date: | 28 Jun 2004 20:05:37 EDT |
>I recall somebody said that typical compilers spend most time
>elsewhere than in the parser, e.g., the actions.
...
>[The numbers I've seen say that the lexer is usually the slowest part
>of a compiler. -John]
One should be aware of, though, that non-deterministic parsers may
dramatically slow down a parser. For example, I translated the
Mini-Prolog that comes with Hugs <http://haskell.org/hugs> from
Haskell into C++, and both versions were mysteriously slow. Then I
replaced its non-deterministic parser with a Flex/Bison generated
lexer/parser combination, and the program suddenly became lightening
fast. So if non-deterministic parsing is needed, one should, for the
sake of speed, probably in the first hand try out some GLR parser,
which sticks to deterministic parsing as far is possible.
Hans Aberg
Return to the
comp.compilers page.
Search the
comp.compilers archives again.