in reply to Re^3: Help tightening up a subroutine please
in thread Help tightening up a subroutine please

Actually, that wasn't a bad idea. Using the hypothetical data set from my response to Eric below, I benchmarked the 2 subs initially posted in this thread. At 50k iterations, here's what I got:

Benchmark: timing 50000 iterations of mybinary, use_grep... mybinary: 15 wallclock secs (15.23 usr + 0.03 sys = 15.26 CPU) @ 32 +76.54/s (n=50000) use_grep: 13 wallclock secs (12.83 usr + 0.04 sys = 12.87 CPU) @ 38 +85.00/s (n=50000) Rate mybinary use_grep mybinary 3277/s -- -16% useagrep 3885/s 19% --

I have not yet tried BrowserUK's latest edition sub yet. That's for this afternoon/evening.

Matt

Replies are listed 'Best First'.
Re^5: Help tightening up a subroutine please
by BrowserUk (Patriarch) on Jan 24, 2007 at 21:49 UTC
    I have not yet tried BrowserUK's latest edition sub yet. That's for this afternoon/evening.

    Ignore it. Since seeing the example data you posted, I tested it against some other variations of test data and it performs badly.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.