5 ms·
His statements about instruction sets are interesting: basically that people get excited about low-level instructions that exploit details of processor archite
by dkarl 14y ago
His statements about instruction sets are interesting: basically that people get excited about low-level instructions that exploit details of processor architecture, but what would really improve performance are high-level instructions that allow software to defer to optimal implementations provided by the processor. Makes sense. Very little software can know the details of the processor architecture on which it will run, JITed code being a major exception.
- jlgreco 14y agoTo what extent does something like the JRE JIT code know about processor specific details? You download a single x86 or x86_64 java binary from Oracle; I guess they could bake in processor specific optimizations for as many processors as they can think of at the time but I think even then the benefits of high level instructions that Linus lays out would be present. At the very least it would simplify what has to happen when a new processor comes out.
- dkarl 14y agoTo what extent does something like the JRE JIT code know about processor specific details? I honestly don't know. The most obvious thing I can think of is that it might check the L1 cache size, which I believe can be discovered even if the processor family is a new one that the JRE doesn't recognize.
- zanny 14y agocat /proc/cpuinfo. That is what the kernel says about the cpu, which is about as much info as you are going to get without some database lookup on specification data given a model number.
- Evbn 14y agoWhich is funny because that is the reason people choose Java and ML over C: to let the compiler do the optimization. But that doesn't always work.
- andreasvc 14y agoI don't see why you imply there would be no optimizations with C, a compiler like gcc does many optimizations as well with a flag like -O3. With Java you do have JIT of course.