Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: (tye)Re: Benchmarking the basic operations

by chipmunk (Parson)
on Jan 26, 2001 at 01:12 UTC ( #54363=note: print w/ replies, xml ) Need Help??


in reply to (tye)Re: Benchmarking the basic operations
in thread Benchmarking the basic operations

Quote:

Yes, then we could make our programs run faster with:
if( $^O =~ /^MSWin/ ) { $comp= $b gt $a; } else { $comp= $a lt $b; }
Well, you must not have done the actual benchmark. I did, and I found that on MSWin32, it's gt that is faster, not lt. So the correct way to optimize this comparison is:
if ($^O =~ /^MSWin/) { $comp= $a gt $b; } else { $comp= $b lt $a; }

;)


Comment on Re: (tye)Re: Benchmarking the basic operations
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2014-09-23 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (241 votes), past polls