4 ms·
"Page align everything" by convention is in fact a form of optimization without profiling. TFA explains in detail why this is yet another bad idea, perhaps you
by AuntTillie 12y ago
"Page align everything" by convention is in fact a form of optimization without profiling. TFA explains in detail why this is yet another bad idea, perhaps you read something in my comment I did not write?
- innocenat 12y agoThat is ridiculous. Page align everything can easily be a leftover code that is fast for old CPU, as you said in your original content. You would still call that premature optimization? Or you think that every time new processor is released, you must re-profile all your original code to see whether the old optimization still solve the hot path?
- erikarn 12y agoTL;DR - yes.
- LnxPrgr3 12y agoProbably the part where you said, "If that is still not enough, extra cloud instances are probably cheaper than wasting your time with extensive profiling and manual optimizations." At least profiling showed the author why page aligning all the things is silly. I have yet to work on an architecture where it isn't at best a waste of time, so I'm not sure why the measurement was necessary, but hey—running the test cured a potential delusion. I also have yet to work on a system that can talk over the network faster than it can to another core that shares a layer of cache with it. Besides, hardware savings are multiplied over all your customers—it's only 1:1 if you're working on software for a single entity. If that's your case, then you're probably right—any time on making quality software is probably wasted because few will benefit, and hardware probably is cheaper than dev time. That's not the world everyone lives in, though.
- AuntTillie 12y agoQuite right, but if you ship software to customers you'd have to profile on a variety of CPUs or risk regressing on other models. Profiling on recent Intel x86_64 CPUs gave me the (perhaps false) impression TFA author writes for a known or even controlled environment. That is indeed not a luxury everyone enjoys, so I raised a portability concern. However, the potential benefits of cheap horizontal scaling also extends to said customers.
- erikarn 12y agoHi! Author here! I use recent Intel CPUs at work but ARM/MIPS/PPC for non-work. The point of the article wasn't to say "do this, it's better!" it's "hey, turns out this easy thing people were doing may be making things slower; maybe you should double-check first."