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: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= $b gt $a; } else { $comp= $a lt $b; }
if ($^O =~ /^MSWin/) { $comp= $a gt $b; } else { $comp= $b lt $a; }
;)
|
---|
In Section
Meditations