in reply to RE: RE: (dchetlin: Benchmark fixes) 30 Spaces- 1 question
in thread 30 Spaces- 1 question
This is perl, v5.6.0 built for i686-linux
Built this version myself on a Linux 2.2.17 box.
UPDATED:
OK I have a new 5.6.0 build at home, on the old
pentium 166 This is perl, v5.6.0 built for i586-linux
That produces these results with your script, no changes,
'cept I whacked the check off the end.
Rate for_index_substr regexp split_join for_index_substr 395/s -- -24% -24% regexp 518/s 31% -- -0% split_join 520/s 32% 0% --
Bet on us looking at different optimizations for processor and platform and compiler.
IMHO, the regex or the index should usually win. The split_join one creates a whole array and then reloops over it to create a new string. the regex just matches along it and then internally $1 is a substr created by the match, you just link a real name to the SV* record. Index should beat a regex and the overhead of creating an inner loop manually and following it shouldn't be that bad, and substr is real fast. =) Your test surprised me cause regex won by so much. This newest one makes no sense.
If all the results turn out to be valid, what are the platform differences, really?
Another box, 5.004_04 i386-linux (oh man does this need an overhaul?) gives me 13sec@regex, 16sec@split, 18.5sec@index. I'm just making this worse, aren't I?
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|