Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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; }

;)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://54363]
help
Chatterbox?
[LanX]: so the mayor of London should be better named First Minister of the London region and is on a comparable level like Nicola Sturgeon
[LanX]: ?

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2017-12-15 18:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (440 votes). Check out past polls.

    Notices?