3 ms·
You are probably right about the heap, but in the stack there are no big data structures. To move all data types to 64bits would impact the stack size of proces
by Hokusai 6y ago
You are probably right about the heap, but in the stack there are no big data structures. To move all data types to 64bits would impact the stack size of processes and threads.
Bigger data structures also mean more cache misses. So, systems would be also slower. As, bringing data from memory to the CPU is very slow compared with accessing L1 or L2 cached data.
So, you have a point. But, it does not apply equally to all data.
- xscott 6y agoLet's take an example in your favor and say you've got 16 integer local variables per stack frame and you're recursing 1000 (!!!) times over some really unbalanced tree or such. You saved 64 kilobytes... Ok, now let's say 32 bit integers are the standard: You either wrote a program that starts to fail in mysterious ways when someone runs it on a 2 GB file, or you complicated the hell out of your data structures by needing arrays of arrays (i.e. https://www.nayuki.io/page/large-arrays-proposal-for-java https://www.nayuki.io/page/large-arrays-proposal-for-java). It should be easier to make correct programs.