Testdata:
IO's code produces [], merlyns 'undef' <- (I tried to change the parens to ([ ]) etc. here), Gilimanjaros gives up on the hash, demerphqs parser is created before the benchmark runs.({"startup-req-3",5,"PerlMud-i3",0,"*gcs",0,0,0,0,0,0,0,"PerlLib v1"," +PerlLib v1","Perl v5.6.1","Perl","restricted access","blah@blah.de",( +["tell":1,"ucache":1,]),0,})
Benchmark called like this:Benchmark: running IO, castaway, demerhpq, merlyn, browserUK , each for at least 5 CPU seconds ... IO: 1 wallclock secs ( 1.09 usr + 0.01 sys = 1.10 CPU) @ 37.27/s (n +=41) browserUK: 1 wallclock secs ( 1.04 usr + 0.01 sys = 1.05 CPU) @ 113 +.33/s (n=119) castaway: 1 wallclock secs ( 1.07 usr + 0.00 sys = 1.07 CPU) @ 103. +74/s (n=111) demerhpq: 1 wallclock secs ( 1.07 usr + 0.00 sys = 1.07 CPU) @ 3.7 +4/s (n=4) merlyn: 1 wallclock secs ( 1.04 usr + 0.01 sys = 1.05 CPU) @ 187.62 +/s (n=197) Rate demerhpq IO castaway browserUK merlyn demerhpq 3.74/s -- -90% -96% -97% -98% IO 37.3/s 897% -- -64% -67% -80% castaway 104/s 2675% 178% -- -8% -45% browserUK 113/s 2932% 204% 9% -- -40% merlyn 188/s 4919% 403% 81% 66% --
More to come when I figure out how to get the rest running properly ;)cmpthese(-5, { # Gilimanjaro => sub {my @arr = parse($testarray1)}, castaway => sub {my @arr = lpcarray_to_array( $test +array1 ); print Dumper(@arr)}, IO => sub{my @arr = lpcarray_to_arrayIO( +$testarray1 ); print Dumper(@arr)}, merlyn => sub{my @arr = parse_string( $testarra +y1); print Dumper(@arr)}, demerhpq => sub{my $arr = $parser->expr($testarray1) +; print Dumper($arr)},; browserUK => sub{my $arr = build_structure($testarray +1); print Dumper($arr)}});
Update: Hmm, that seems to be junk, since cmpthese isn't reading $testarray1 (which is declared as 'my').. *sigh*
Update 2: Real results, I hope, thanks BrowserUK!
my script results (not a full time webserver)
C.
In reply to Re: Parsing Text into Arrays..
by castaway
in thread Parsing Text into Arrays..
by castaway
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |