Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Out-Of-Date Optimizations? New Idioms? RAM vs. CPU

by PhilHibbs (Hermit)
on Aug 14, 2003 at 13:54 UTC ( #283875=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Re: Out-Of-Date Optimizations? New Idioms? RAM vs. CPU
in thread Out-Of-Date Optimizations? New Idioms? RAM vs. CPU

And a good way to ruin cache hits is to use a garbage-collecting language.

In reply to Aristotle:
The theory is (and I haven't profiled this myself, just passing on received wisdom) is that when the GC goes off to clear out old memory, it has to read it into the cache to do so. If the memory were released as soon as it were finished with, then the page could just be discarded as necessary. Of course, the effect on processor cache is just one factor, and it may be that good GC systems can make up for this in other ways, but I don't like them anyway. I much prefer deterministic release of resources.
I first heard of this theory from comments by Linus Torvalds, if you'll excuse the name dropping, and it seems to make sense to me. Of course it may be that the pages visited by the GC are pages that are going to be needed real soon. A good reminder that the first rule of optimisation is: don't, and the second is: do some profiling first.

  • Comment on Re: Out-Of-Date Optimizations? New Idioms? RAM vs. CPU

Replies are listed 'Best First'.
Re^2: Out-Of-Date Optimizations? New Idioms? RAM vs. CPU
by Aristotle (Chancellor) on Aug 14, 2003 at 19:51 UTC

    Any backup for your claim? All arguments I’ve heard so far indicate the opposite – which I’d be inclined to believe, unless you’re allocating and releasing memory in a tight loop. (But that would cause thrashing regardless of a garbage collector anyway…) So what would support a claim to the opposite?

    Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://283875]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-05-26 20:14 GMT
Find Nodes?
    Voting Booth?