Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Help w/ Code Optimization

by John M. Dlugosz (Monsignor)
on Dec 27, 2001 at 02:08 UTC ( [id://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.

—John

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (7)
As of 2024-04-23 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found