in reply to Re^3: Convert string to array - performance challenge
in thread Convert string to array - performance challenge

I see some variablility, but nothing like those levels using AS perls.

AS1007 64-bit:

c:\test>junk Rate regex unpack_C unpack_a split regex 7.95/s -- -1% -10% -14% unpack_C 8.01/s 1% -- -10% -14% unpack_a 8.88/s 12% 11% -- -4% split 9.30/s 17% 16% 5% -- c:\test>junk Rate regex unpack_C unpack_a split regex 7.95/s -- -0% -8% -12% unpack_C 7.95/s 0% -- -8% -12% unpack_a 8.68/s 9% 9% -- -4% split 9.09/s 14% 14% 5% -- c:\test>junk Rate unpack_C regex unpack_a split unpack_C 8.02/s -- -0% -9% -11% regex 8.02/s 0% -- -9% -11% unpack_a 8.81/s 10% 10% -- -2% split 9.02/s 13% 13% 2% -- c:\test>junk Rate unpack_C regex unpack_a split unpack_C 7.95/s -- -0% -9% -13% regex 7.95/s 0% -- -9% -13% unpack_a 8.74/s 10% 10% -- -5% split 9.16/s 15% 15% 5% --

AS826 32-bit:

c:\test>\perl32\bin\perl junk.pl Rate unpack_C split regex unpack_a unpack_C 8.38/s -- -5% -9% -15% split 8.81/s 5% -- -5% -11% regex 9.23/s 10% 5% -- -6% unpack_a 9.86/s 18% 12% 7% -- c:\test>\perl32\bin\perl junk.pl Rate unpack_C split regex unpack_a unpack_C 8.45/s -- -5% -8% -15% split 8.87/s 5% -- -3% -11% regex 9.16/s 8% 3% -- -8% unpack_a 9.94/s 18% 12% 9% -- c:\test>\perl32\bin\perl junk.pl Rate unpack_C split regex unpack_a unpack_C 8.38/s -- -5% -8% -14% split 8.81/s 5% -- -4% -10% regex 9.16/s 9% 4% -- -6% unpack_a 9.78/s 17% 11% 7% -- c:\test>\perl32\bin\perl junk.pl Rate unpack_C split regex unpack_a unpack_C 8.38/s -- -5% -8% -14% split 8.81/s 5% -- -4% -10% regex 9.16/s 9% 4% -- -6% unpack_a 9.78/s 17% 11% 7% --

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.
"I'd rather go naked than blow up my ass"

Replies are listed 'Best First'.
Re^5: Convert string to array - performance challenge
by ikegami (Patriarch) on Apr 08, 2010 at 16:54 UTC

    split // was optimised to not use the regex engine on 9 Aug 2007. The 5.8 build you are using probably predates that.

    I got the same variability between regex and unpack_C with 5.10. They are basically equivalent in terms of performance.