Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Re: Re: On Golf

by rchiav (Deacon)
on May 21, 2001 at 18:51 UTC ( #81983=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: On Golf
in thread On Golf

Just to add to this, in C, a for-loop is smaller but less optimized than writing out each statement seperately.

And using cos() or other trig functions might be smaller but a lookup table is much faster.

When you're not specifically dealing with instructions, code size doesn't really have any correlation to speed.

Rich


Comment on Re: Re: Re: On Golf
Re^4: On Golf
by FoxtrotUniform (Prior) on Jul 14, 2004 at 21:01 UTC

    Just to beat a dead horse:

    in C, a for-loop is smaller but less optimized than writing out each statement seperately.

    ...unless the unrolled loop's extra code size causes a cache miss across a slow bus, in which case the for-loop is more optimized (assuming, of course, that the loop fits in a cache line).

    --
    F o x t r o t U n i f o r m
    Found a typo in this node? /msg me
    % man 3 strfry

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-08-01 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Who would be the most fun to work for?















    Results (11 votes), past polls