I have been working on a Perl parser on and off for a few years, though since it has always been in pre-alpha, I have never worried about speeding it up. However, I have started working on ways to optimize it, and was surprised at what I found.
After some algorithmic and regex optimizations, a normal execution takes around 3.5 seconds, of which, about 2.3 is the time it takes for Perl to start up (which I measured with "time perl scriptname.pl" after putting a "die("Done");" in the first line). I understand that Regexp::Grammars isn't the speediest Perl module out there, but it seems that its initialization takes much longer than actually executing the script.
Therefore, I started looking into an easy way of compiling it down to bytecode before running it. It seems B::Bytecode, the only functional way to do this, is no longer maintained or included in the main Perl distribution. Is there any easy way for me to decrease the startup time?
Thanks!