Earlier quoted context omitted.
It’s much harder than that because the JIT is speculating on what lots of objects in the heap are doing, including watchpointing them to constant fold properties. It’s not clear what the key should be in that case. Still not impossible but I want to be clear on what exactly makes this hard. CPU model for example is not what makes it hard.
> including watchpointing them I assume this isn't literally using hardware watchpoints?
Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
41–50 of 93 posts
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#42Ugh at risk of being the grumpy old programmer: jit code is just never going to touch actual handwritten native code in performance. It's been like 50 years. If we care about performance we need languages for it.
In some sense we can always fully specialize a program to its current input and make a lot of radical changes to data layout and represesentation. But in languages like C/C++ where programs can "see" struct/array layout, member order, pointers as integer values that have fixed order, spacing, grouping based on the program specified data types, this is prohibitively complicated.
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#43Earlier quoted context omitted.
That would be great but it’s hard because the trick, at least in JS VMs, is to have the JIT specialize based on the heap. So you’d need a heap snapshot or some way to link the generated code to a different heap. Maybe not impossible, just hard enough that it’s not widespread.
It does seem like you could do JIT with a persistent cache which stores the JIT output along with a key that's a hash of all the relevant system parameters like CPU model and VM parameters like heap size. This would mean that the typical case of re-running a program in the same environment would be pre-warmed.
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#44Stupid question for people who know more about these things. Why can’t we fight the warmup time by running an already warmed up snapshot of the program? Or say dumping some data structure when it hits steady state to give hints to the JIT the next time it runs?
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#45I love intellij idea, but it's pretty damn slow for a lot of things (though never quite as bad as eclipse). I have always wondered if the JVM is optimizing for tasks that happen at startup, at the expense of performance during use. It would be a shame if the slow performance simply came down to the JVM profiling at startup and determining that the core function of the entire program was to index the code in your work…
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#46Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#47Earlier quoted context omitted.
I mostly agree, but compilers intentionally don't explore every optimization path to save compilation time, and a JIT is able to trace the program for real data and find places that could benefit from additional attention. I don't think JITs are the only way to address that trade-off in compilation time vs runtime performance metrics, and whether their benefits are worth their other costs is an interesting, program-d…
Any languages explore both? Compile to native and run with a jit which profiles and optimizes further based on runtime behavior?
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#48The reality is... it's been decades and while JVM languages can be pretty fast, I have yet to see many non-contrived examples where the VM based language consistently outperforms competently written but not heavily optimized C++. Even then, extensive tuning is done to the VM. Heck, with the advent of Go you now have another great higher level language that consistently outperforms Java/Scala, has top notch garbage co…
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#49The reality is... it's been decades and while JVM languages can be pretty fast, I have yet to see many non-contrived examples where the VM based language consistently outperforms competently written but not heavily optimized C++. Even then, extensive tuning is done to the VM. Heck, with the advent of Go you now have another great higher level language that consistently outperforms Java/Scala, has top notch garbage co…
Is ballast[1] still required for certain use cases?
[1]: https://blog.twitch.tv/en/2019/04/10/go-memory-ballast-how-i...
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#50Stupid question for people who know more about these things. Why can’t we fight the warmup time by running an already warmed up snapshot of the program? Or say dumping some data structure when it hits steady state to give hints to the JIT the next time it runs?