Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: Help w/ Code Optimization

by John M. Dlugosz (Monsignor)
on Dec 27, 2001 at 02:08 UTC ( #134493=note: print w/replies, xml ) Need Help??

in reply to Re: Help w/ Code Optimization
in thread Help w/ Code Optimization

Once upon a time, that was a good idea for PC's. On a 80486, where shift took 1 clock and multiply took up to 40, it was still faster sometimes. Note I said "up to" because it stops early, and essentially does this same thing internally--one addition for each '1' bit, using a barrel shifter that skips the zeros.

But with Pentium and later, the multiply is just as fast as anything else, and breaking it up into multiple steps makes it slower, by far.


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2023-03-31 04:17 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (74 votes). Check out past polls.