Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Re: Re: Re: lc entire contents of array?

by Willard B. Trophy (Hermit)
on Mar 31, 2004 at 15:30 UTC ( [id://341312]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: lc entire contents of array?
in thread lc entire contents of array?

$ ./dave_the_m.pl Benchmark: timing 1000000 iterations of for, map... for: 2 wallclock secs ( 2.03 usr + 0.00 sys = 2.03 CPU) @ 49 +2610.84/s (n=1000000) map: 1 wallclock secs ( 1.12 usr + 0.00 sys = 1.12 CPU) @ 89 +2857.14/s (n=1000000)

That was Perl 5.8.0 on a P3-600. I got similar results on a Sparc box with 5.8.2.

I rather think we might be benchmarking other things than just the map and the for. For instance, lcing an array with 10,000 elements doesn't seem to take appreciably longer than one with 1,000 elements.

Anyway, wiser monks have already pointed out that legibility should come first. Optimisation is a hardware problem.

--
bowling trophy thieves, die!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2024-03-29 01:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found