[identity profile] lightning-rose.livejournal.com 2009-12-20 09:59 pm (UTC)(link)

"optimize for instruction count" makes sense in a universe where a megabyte is a huge (and hugely expensive) amount of RAM. Especially on a machine with virtual memory* and poor page swapping algorithms. A program that exceeded it's available RAM by even a few bytes could take a horrible hit in performance due to disk swapping. A less than speed optimal program may well outperform a speed optimized program if stays resident in RAM.


*) Virtual memory in it's original sense, not today's definition which is mostly just memory management.

[identity profile] mentalguy.livejournal.com 2009-12-22 01:08 am (UTC)(link)
These days, replace "RAM" with "instruction cache". Cache misses really hurt.

[identity profile] lightning-rose.livejournal.com 2009-12-27 05:30 pm (UTC)(link)

Indeed. I have disabled cache on pc's just to see how much the performance drops. Tip: don't do this with an o/s that boots into a gui.

I've also done a fair amount of embedded kernel development so I've benchmarked the differences between cache on and cache off at boot time.

[identity profile] kragen.livejournal.com 2009-12-22 07:54 pm (UTC)(link)
"optimize for smallest code size" makes more sense in that context, and the comment you're replying to asserts that "optimize for instruction count" tended to produce bigger code than "optimize for smallest code size", which is unsurprising. (The surprising part is that "optimize for smallest code size" existed.)

[identity profile] lightning-rose.livejournal.com 2009-12-27 05:39 pm (UTC)(link)

You're right, I mis-read the comment. my above comment should have been in regards to "optimize for smallest code size".

vatine: Generated with some CL code and a hand-designed blackletter font (Default)

[personal profile] vatine 2009-12-29 11:30 am (UTC)(link)
It would've made sense, if it wasn't for the fact that the really powerful instructions (as in "did lots of stuff") usually ended up being MASSIVELY huge, memory-wise. We're talking machine instructions in the multiple tens of bytes, here.