Live data from Hacker News

A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

youtube.com

51–60 of 64 posts

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#51
post #50

Earlier quoted context omitted.

As I cautioned in another comment > (or did, last time I checked) Do implementations of .NET JITs now do speculative optimisations or dynamic compilation? They didn't see the need for it for about 15 years.

15 years ago there weren't RyuJIT which replaced the JIT you learned from, MDIL (Windows 8/8.1), .NET Native (UWP), IL2CPP (Unity), and the research ones from Singularity and Midori. In what concerns the need for it, they have been trying to make C# more relevant for the kinds of C++ workloads and getting among the first places at TechEmpower. So .NET has been getting Modula-3 like low level handling of value types w…

So which of these implementations does speculation? I remember when RyuJIT came out it still wasn't speculative - has that now changed?

If you read the blog posts, they always talk about speculation being something they may try in the future. I've not seen anything where they say they went ahead and implemented it.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#52
post #34

Earlier quoted context omitted.

> [...] which is what for example .NET does. .NET is the platform. There are different implementations for it doing different things. JIT compilation is still different to AOT even without profile guided optimizations. Simple example: In AOT code you can't embed pointers easily and is often solved with indirection (e.g. something like GOT in ELF).

> There are different implementations for it doing different things. And are they now speculative? They weren't for the first 15 years or so.

CoreCLR started to implemented Tiered Compilation https://github.com/dotnet/coreclr/blob/master/Documentation/...

It's experimental currently, no profile guided optimizations _yet_

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#53
post #49

Earlier quoted context omitted.

Maybe I'm only familiar with "the main one" and mono... Are there other .NET VMs? If I recall correctly, it will do constant folding, but won't speculate that a certain parameter is always essentially constant at runtime, but wasn't at compile time. An easy example is a config loaded from a file as the server boots but never changes for the lifetime of the process. That won't constant fold without speculation.

There is the old style JIT, RyuJIT introduced with .NET Framework 4.6, MDIL, .NET Native, Mono, .NET CF, IL2CPP, and the research ones from Singularity and Midori. So while it is hard to state what each AOT/JIT compiler is capable of, naturally they aren't 100% all the same.

Ah! I should read more about the world. I was recalling from a conversation I had with a .NET engineer at JVMLS last year.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#54
post #50

Earlier quoted context omitted.

15 years ago there weren't RyuJIT which replaced the JIT you learned from, MDIL (Windows 8/8.1), .NET Native (UWP), IL2CPP (Unity), and the research ones from Singularity and Midori. In what concerns the need for it, they have been trying to make C# more relevant for the kinds of C++ workloads and getting among the first places at TechEmpower. So .NET has been getting Modula-3 like low level handling of value types w…

So which of these implementations does speculation? I remember when RyuJIT came out it still wasn't speculative - has that now changed? If you read the blog posts, they always talk about speculation being something they may try in the future. I've not seen anything where they say they went ahead and implemented it.

Here is some information

Background JIT overview, which is a kind of PGO for the .NET Frameworok

https://msdn.microsoft.com/en-us/magazine/mt683795.aspx

And I think this goes into line with what you are discussing,

https://github.com/dotnet/coreclr/pull/21270

I also agree that many things remain to be done in line with what Graal is capable of.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#55
post #52

Earlier quoted context omitted.

> There are different implementations for it doing different things. And are they now speculative? They weren't for the first 15 years or so.

CoreCLR started to implemented Tiered Compilation https://github.com/dotnet/coreclr/blob/master/Documentation/... It's experimental currently, no profile guided optimizations _yet_

.NET Framework supports PGO since .NET 4.5.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#56
What's the current status of Graal's Python implementation in terms of reaching actual usability? The README on its GitHub repo [1] doesn't inspire much confidence but whenever I check that wording hasn't changed.

I've been following Graal for quite some time, both as a former PLDI guy but also for my day job. I work in bioinformatics software (mostly cancer genomics research) and our group has a ton of (mostly legacy) code in Java and R, but most of the newly-minted grads coming in lean towards Python.

As one of the guys pulling all this stuff together, the Graal "polyglot" multilingual VM concept is of tremendous interest as you can imagine. It would be great to be able to package the legacy stuff interoperably with the new stuff no matter the language, even setting aside the bonus of better performance. But it has basically no practical use to us without Python (+ packages!) due to the direction and language inclinations of the group.

Is there anything new happening on that front? Or anything we could do to help it along? Is there more a detailed status page anywhere? Any sense of when this might land in a truly usable form, or what's the hold up?

I'm a bit surprised that the progress with R (with packages) is so far along but the progress with Python (with packages) seems stagnant (at least according to that README). No offense meant to the team, but that's the appearance. Is it the GIL?

[1] https://github.com/graalvm/graalpython, which calls it "early-stage experimental" and "very likely that any Python program that requires any packages at all will hit something unsupported".

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#57
post #54

Earlier quoted context omitted.

So which of these implementations does speculation? I remember when RyuJIT came out it still wasn't speculative - has that now changed? If you read the blog posts, they always talk about speculation being something they may try in the future. I've not seen anything where they say they went ahead and implemented it.

Here is some information Background JIT overview, which is a kind of PGO for the .NET Frameworok https://msdn.microsoft.com/en-us/magazine/mt683795.aspx And I think this goes into line with what you are discussing, https://github.com/dotnet/coreclr/pull/21270 I also agree that many things remain to be done in line with what Graal is capable of.

[deleted]

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#58
post #54

Earlier quoted context omitted.

So which of these implementations does speculation? I remember when RyuJIT came out it still wasn't speculative - has that now changed? If you read the blog posts, they always talk about speculation being something they may try in the future. I've not seen anything where they say they went ahead and implemented it.

Here is some information Background JIT overview, which is a kind of PGO for the .NET Frameworok https://msdn.microsoft.com/en-us/magazine/mt683795.aspx And I think this goes into line with what you are discussing, https://github.com/dotnet/coreclr/pull/21270 I also agree that many things remain to be done in line with what Graal is capable of.

Yeah, I think this is the relevant bit: https://github.com/dotnet/coreclr/blob/master/Documentation/...

Seems like they started trying speculative optimizations about six months ago. Speculative optimizations are not only the foundation of Graal but also of C2, BTW.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#59
post #10

Earlier quoted context omitted.

Another advantage they have is that they can focus the spent optimization cycles on hot code. AOT compilers can't afford running optimization passes in a loop (inline, optimize, inline, optimize, ...) until they reach a fixed point because that would blow up compile times if that were applied to the whole program.

This almost never matters. You just start at the leaves and go up and then you're done. Most people aren't interested in complicated superoptimizations, because a predictable compiler is more important.

That's not true. A lot of very simple and useful optimizations are very hard to prove correct (e.g. devirtualization) and so can't be done with AOT compilers. It doesn't matter to people using languages that require the programmer to carefully control the compiler -- like C/C++ or Rust -- but it matters a great deal to languages that offer a smaller number of more general abstractions. It is virtually impossible to compile, say, JavaScript efficiently with an AOT compiler, but when compiled with a JIT it can have excellent performance.

Re: A Race of Two Compilers: GraalVM JIT versus HotSpot JIT C2 [video]

#60
post #56

What's the current status of Graal's Python implementation in terms of reaching actual usability? The README on its GitHub repo [1] doesn't inspire much confidence but whenever I check that wording hasn't changed. I've been following Graal for quite some time, both as a former PLDI guy but also for my day job. I work in bioinformatics software (mostly cancer genomics research) and our group has a ton of (mostly legac…

I had decent luck with Nuitka[1] as long as the project is 100% python. The executables are large but have been mostly portable IME (some glib problems can arise though).

Largest project I compiled was only ~1000 lines but used external deps of pymysql, jinja2, ldap3 along with the stdlib's shutil, tempfile, pathlib, and the base os lib without issues. It takes ~30 minutes to compile on a decently powerful machine though (8650u and 32gb of ram). Most of this time was spent on pymysql and jinja2's compilation.

[1] https://nuitka.net/

Post reply on HN