Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Replacing $mon with Jan, Feb, Mar by regex or other means

by RMGir (Prior)
on Apr 25, 2003 at 12:14 UTC ( [id://253147]=note: print w/replies, xml ) Need Help??


in reply to Re: Replacing $mon with Jan, Feb, Mar by regex or other means
in thread Replacing $mon with Jan, Feb, Mar by regex or other means

I did consider that, but since the strftime variant was already losing badly, it didn't seem critical.

You're right, though, wrapping the fetch of @fixedLocaltime in a sub (returning a ref to the array) call kills the performance of the strftime variant a bit more.

$ perl testMonth.pl Benchmark: running inlineArrayLookup, preBuiltArrayLookup, strftimeLoo +kup, strftimeSubLookup, substrLookup, each for at least 2 CPU seconds +... inlineArrayLookup: 2 wallclock secs ( 2.12 usr + 0.00 sys = 2.12 CP +U) @ 513847.17/s (n=1089356) preBuiltArrayLookup: 2 wallclock secs ( 2.09 usr + 0.01 sys = 2.10 +CPU) @ 568700.00/s (n=1194270) strftimeLookup: 1 wallclock secs ( 1.81 usr + 0.35 sys = 2.16 CPU) +@ 223003.24/s (n=481687) strftimeSubLookup: 2 wallclock secs ( 1.74 usr + 0.26 sys = 2.00 CP +U) @ 182455.50/s (n=364911) substrLookup: 2 wallclock secs ( 2.19 usr + 0.01 sys = 2.20 CPU) @ +446835.91/s (n=983039) Rate strftimeSubLookup strftimeLookup substrLo +okup inlineArrayLookup preBuiltArrayLookup strftimeSubLookup 182455/s -- -18% +-59% -64% -68% strftimeLookup 223003/s 22% -- +-50% -57% -61% substrLookup 446836/s 145% 100% + -- -13% -21% inlineArrayLookup 513847/s 182% 130% + 15% -- -10% preBuiltArrayLookup 568700/s 212% 155% + 27% 11% --

--
Mike

Edit by tye, change PRE to CODE around long lines

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://253147]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-03-29 08:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found