|Perl: the Markov chain saw|
Benchmark results | localizing $INPUT_RECORD_SEPARATOR vs spliting contents of file on $INPUT_RECORD_SEPARATORby ashish.kvarma (Monk)
|on Nov 06, 2012 at 12:16 UTC||Need Help??|
ashish.kvarma has asked for the
wisdom of the Perl Monks concerning the following question:
I was looking and arunshankar.c's post XML parsing and thought same could be done (slightly faster) using localized $INPUT_RECORD_SEPARATOR.
Below are the results and the benchmark code I used.
I have run this multiple times with different values of $count, Spiting string seems to have slight advantage in all cases.
For a while I though I may be doing something wrong in the code, though at least I am not able to see if there is any issue with the code. I guess splitting is a bit faster (probably not significant, but it is what it is).
P.S: Don't know if its important but just for information, I am using Active Perl 5.16 on Windows 7, 32 bit, Intel Core i3.