3 ms·
Does dynamic compilation really that much better than profile guided optimization? That is, I suspect that in the situation you describe a C++ compiler using P
by Symmetry 14y ago
Does dynamic compilation really that much better than profile guided optimization? That is, I suspect that in the situation you describe a C++ compiler using PGO would do just as well at detecting which of the implementations are present. In theory this might change between runs, but I can't believe that's as common as it being the same.
- pron 14y agoI suspect that in the situation you describe a C++ compiler using PGO would do just as well Quite possibly, though not necessarily better. And you still won't have the memory management advantages. But let me revise my statement: if you have unconstrained development resources, you could probably make large C++ software a little faster than a Java counterpart in many cases, but that little improvement would come at a very big development cost in almost all cases.
- Symmetry 14y agoIn cases where developers have unconstrained resources I'd actually expect C{,++} to be about 50% faster than Java as you see in the programming languages shootout due to better ability to optimize memory use. But I'd expect most professionally produced software to use PGO, and hence get most of the same benefit from runtime information as Java.
- pron 14y agoBut you can't optimize large software that has to be maintained. Even if you could (because you have unlimited resources), you won't be getting a 50% improvement because you'll be spending a lot of the time on IO and task switching anyway. And just to make sure: whatever improvement you get will be very costly. We're talking manual control of memory fences, NUMA memory allocation and placement, lock biasing and more. All stuff the JVM does a very good with little effort for the Java programmer.