Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 browsing the Monastery: (8)
As of 2014-11-25 23:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (160 votes), past polls