CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [anglaissam] Regex benchmark: Edit Log



FishMonger
Veteran / Moderator

Jul 22, 2013, 12:54 PM


Views: 33636
Re: [anglaissam] Regex benchmark

I believe you're misreading the results. The order of the output from Benchmark is from slowest to fastest and the rate column shows the number of executions per second.

I enabled warnings to point out a side problem with your benchmark.


Code
D:\test>anglaissam.pl 
Unrecognized escape \A passed through at D:\test\Perl-3.pl line 18.
Unrecognized escape \D passed through at D:\test\Perl-3.pl line 18.
Unrecognized escape \T passed through at D:\test\Perl-3.pl line 18.
Unrecognized escape \A passed through at D:\test\Perl-3.pl line 23.
Unrecognized escape \D passed through at D:\test\Perl-3.pl line 23.
Unrecognized escape \T passed through at D:\test\Perl-3.pl line 23.
Unrecognized escape \A passed through at D:\test\Perl-3.pl line 28.
Unrecognized escape \D passed through at D:\test\Perl-3.pl line 28.
Unrecognized escape \T passed through at D:\test\Perl-3.pl line 28.
Rate Code2 Code1 Code3
Code2 41041/s -- -71% -96%
Code1 142605/s 247% -- -88%
Code3 1141304/s 2681% 700% --
Press any key to continue . . .


I then changed the test to use references to the subs rather than closures and here's that result.


Code
           Rate Code2 Code1 Code3 
Code2 42982/s -- -72% -98%
Code1 151253/s 252% -- -92%
Code3 1868327/s 4247% 1135% --
Press any key to continue . . .



(This post was edited by FishMonger on Jul 22, 2013, 12:55 PM)


Edit Log:
Post edited by FishMonger (Veteran) on Jul 22, 2013, 12:55 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives