Live data from Hacker News

Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

tratt.net

1–10 of 93 posts

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#2
It would be better if VM comparisons included JSC rather than, or in addition to, V8. JSC tends to outperform V8 so if you find a pathology in V8 it’s just not so surprising. It would be more interesting if you found a pathology in JSC.

I think that the use of small benchmarks obscures what’s going on. The VM is trying to win in the average. It’s like a professional gambler. Observing that the VM did something dumb for a program is like observing that a professional gambler lost a bet. That’s not interesting. In a game of chance, even a really great strategy will have its outliers.

I think that to understand the quality of a VM you have to throw millions of lines of code at it and see if the optimizing JIT can consistently produced speedups or at least produced speedups more often than not using some aggregate metric. As someone who studies the behavior of JSC on million line code bases, I can tell you that a pretty good outcome is if only a small number of functions experience an “upside down” effect from optimization and ends up running slower over time.

Finally, the whole search for a methodology to pinpoint warmup is broken. It’s pure brain damage. VMs need to be fast even for small programs that don’t have a chance to warmup. Startup time is absolutely important. So it’s a methodological antipattern to even try to find the warmup.

The questions worth asking are:

- for some program, how long does it take to run that program. Start to finish. No ignoring warmup.

- how long does it take to run some very long program or the average running time of a small program averaged over many iterations

- some percentile of behavior, like the 99th, to get an average of the janky behavior.

Ideally you measure all of those things and include both short running and long running programs.

This tells you how good a VM is.

If you’re doing math or methodology to identify the warmup point then you’re effectively biasing your experiment to forgive VMs for bad behavior so long as that bad behavior happens early. Nothing could be sillier. Users care about the perf of their VMs at startup not just in steady state.

Anyway, that’s the way I like to do optimizations in JSC.

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#3
I suspect that part of the issue is that when devs are writing and testing their code, they rarely keep the VM running for long enough to reach peak performance. So the performance still feels slow to developers, and performance issues still block the develop/reload/test cycle.

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#4

I suspect that part of the issue is that when devs are writing and testing their code, they rarely keep the VM running for long enough to reach peak performance. So the performance still feels slow to developers, and performance issues still block the develop/reload/test cycle.

Some VMs are a lot better than others at startup.

Some programs don’t “run long enough” in the way the VM needs even when users run those programs.

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#6

It would be better if VM comparisons included JSC rather than, or in addition to, V8. JSC tends to outperform V8 so if you find a pathology in V8 it’s just not so surprising. It would be more interesting if you found a pathology in JSC. I think that the use of small benchmarks obscures what’s going on. The VM is trying to win in the average. It’s like a professional gambler. Observing that the VM did something dumb f…

Not measuring VM startup time has a long tradition in papers. It was the Original Sin (TM).

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#7

I suspect that part of the issue is that when devs are writing and testing their code, they rarely keep the VM running for long enough to reach peak performance. So the performance still feels slow to developers, and performance issues still block the develop/reload/test cycle.

This is what overnight "regression" & "aging" (where you run the test suite over and over, to try and capture those rarely-seen corner cases) tests are supposed to capture.

I'd be surprised if the VM developers didn't run these.

More likely, the environment the VMs are run in has changed in the decades since their development: amount of RAM, cache size, latency of one subsystem over another....

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#8
post #5

Ugh 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.

Totally true. JITs are just about making the dynamic languages perform better than if they were interpreted. If you want native perf you need a statically typed and ahead of time compiled language.

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#9
post #5

Ugh 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.

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-dependant question, but they have strictly more information available than a naive compiler and can potentially use that to make better decisions.

Re: Why Aren’t More Users More Happy With Our VMs? Part 1 (2018)

#10
It occurs to me that, in practical terms, the "steady state" of performance with the increasingly large blobs of JavaScript we find littered throughout the web tends to impact the user more than other JITs. As the user navigates from page to page, the VM is reset, a fresh set of minified blobs is downloaded and JITed, and a core or two is pinned to do so. That translates pretty directly to a hotter phone, less battery life, and a frustrated user. Sure, when your JVM startup is 0.1% of the runtime of your program, it's not as big of a deal, but when it's more like 20% of the time a user spends using the program (their web browser), it's a lot worse, and has slim potential for improvement.
Post reply on HN