lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


It was thus said that the Great Sean Conner once stated:
> 
>   So far, so good.  The new method works, but there's one issue---it's about
> twice as slow as the one I wrote using the 're' module.  It's not the
> loading of a bazillion modules, since when testing my 're' module, I still
> "require" all the above modules, in addition to "org.conman.parsers.email". 
> But I'm at a loss as to how to go about profiling the code.  There are three
> things that confound the issue---the Lua VM, the Lua code itself, and the
> LPEG VM. Does anyone have any ideas how I would go about profiling the code?
> I can provide the code upon request (warning:  it's over 60 files).
> 
>   Any help or ideas would be appreciated.  Thanks.

  Okay, one thing I did was recompile LPEG to activate the ptree() function,
and dump both the 're' compiled version any my LPEG version.  The output was
very surprising.

	're' version [1]:   3,212 lines long
	'lpeg' version:   611,931 lines long

  It appers that 're' does a better job of generating LPEG than I did by
hand.  I'm surprised that the 'lpeg' version was only twice as slow, given
the results.

  -spc (Wonders if it's worth going back to the drawing board ... )