speed

John Lenton john at grulic.org.ar
Thu Aug 19 09:54:32 EDT 2004


On Thu, Aug 19, 2004 at 03:37:26PM +0200, Peter Kleiweg wrote:
> 
> I implemented a lexer in Pylly and compared it to the version I
> had written in Flex. Processing 219062 lines took 0.9 seconds in
> C (from Flex), and 5 minutes 54 second in Python (from Pylly), a
> ratio of 393 to 1.
> 
> Is this normal for Python, or does Flex produce better parsers
> than Pylly? I have been looking at the code produced by Flex to
> see if I could translate it to Python automaticly. But it has a
> lot of goto statements, and I haven't figured out how to
> translate those to Python efficiently.

flex has an option to generate code without the gotos...

-- 
John Lenton (john at grulic.org.ar) -- Random fortune:
Don't read everything you believe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20040819/c2530c50/attachment.sig>


More information about the Python-list mailing list