Earlier 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?
Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
31–40 of 93 posts
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#32Stupid 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)
#33Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#34JIT is very nice in theory. It's great in certain applications (eg; in very tightly scoped domains like accelerating linear algebra). Its proponents always talk about how it allows for optimizations that would be too costly or difficult when doing AOT compilation. But the operational complexity to get it to actually perform at that level on a production language VM (eg; oracle's JVM) is often its undoing.
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#35Earlier quoted context omitted.
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.
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.
I assume this isn't literally using hardware watchpoints?
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#36Stupid 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)
#37Earlier quoted context omitted.
Isn't that just compiling, then?
Sure, but something like Java already has to be compiled. Throw a few more minutes in there, maybe run the test suite a couple thousand times.
Also, the charecteristics of your test suite may be very different than how it is run in production.
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#38Stupid 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)
#39The 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…
Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)
#40Stupid 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?