[Israel.pm] PPI::XS::Tokenizer: Benchmark

Shmuel Fomberg semuelf at 012.net.il
Fri Aug 27 04:50:46 PDT 2010


Hi All.

I tried to use Benchmark and see if the effort of PPI::XS::Tokenizer was 
worth it. so here are the results:

Pure perl:
timethis 1000: 260 wallclock secs (257.66 usr +  0.28 sys = 257.94 CPU) 
@  3.88/s (n=1000)

with PPI::XS::Tokenizer
timethis 1000: 206 wallclock secs (203.29 usr +  0.67 sys = 203.96 CPU) 
@  4.90/s (n=1000)

The testing code was simple:
timethis( 1000, sub { 
PPI::Document->new("C:\\strawberry\\perl\\site\\lib\\PPI\\Node.pm") } );

Using the XS module shaves 20% of the time for PPI-ing a file.
(for this file, from 0.257 seconds to 0.208 seconds)

So, was it worth it?

Shmuel.




More information about the Perl mailing list