First test results:

Testdata:

({"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,})
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.
So I guess the timings are a little skewed anyway ;)

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% --
Benchmark called like this:
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)}});
More to come when I figure out how to get the rest running properly ;)

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.