|
|
|
|
|
by kragen
1919 days ago
|
|
> Anyone with experience optimizing knows this is not true...This is where you have a deep misconception. …Do you profile your programs? There's Dunning–Kruger, and then there's Dunning–Kruger of the level "telling a guy whose Ph.D. dissertation, Specialising Dynamic Techniques for Implementing The Ruby Programming Language, is about code optimization on GraalVM, that he has a deep misconception, and questioning whether he has any experience optimizing". I repeat my complaint about "the climate of boastful intellectual vacuity this site fosters." |
|
I'm not really sure how anything I'm saying is even controversial unless someone is desperate for it to be.
Anyone who has profiled and optimized software has experience weeding out excessive memory allocations since it is almost always the lowest hanging fruit.
No matter how fast allocating a few bytes is, doing what you are ultimately trying to do with those bytes is much faster.
Allocating 8 bytes in 150 cycles might seem fast, until you realize that modern CPUs can deal with multiple integers or floats on every single cycle.
A 12 year old CPU can allocate space for, and add together well over 850 million floats to 850 million other floats in a single second on a single core. You can download ISPC and verify this for yourself. By your own numbers, the allocation alone would take about a minute and a half.
Neither of you has confronted this. I'm actually fascinated by the lengths you both have gone to specifically to avoid confronting this. Saying that lots of small allocations has no impact on speed is counter to basically all optimization advice and here I have explained why that is.