The stopper I found was the abysmal debugging support, I hope that has improved in the meantime.
The stopper I found was the abysmal debugging support, I hope that has improved in the meantime.
Debugging is one area where the form factor will likely demand different behavior vs. JIT, so it will be an evolving scenario. It would be great to know what you would expect vs. what you saw, and importantly what you expect to be different from a traditional native debugging experience (like in C++).
you want consistent perf, AOT makes more sense over there
Unity game devs for example had to fight with the mono JIT by warming up their gameplay code otherwise it'd introduce micro stutters
> AOT may be bad for real time audio due to compile-time assumptions and other heuristics that are limited by the lack of run-time history.
> JIT is probably bad for real time audio, unless you take special precautions to pre-condition the execution context with a workload that approximate the live one.
How does this sound?
You could presumably JIT to a page, warm it up by running in a separate thread, then swap it in...
But for me, I'm not sure what gain that gives over AOT, and certainly adds background churn
do a google search
a audio VST, a game, a CLI are not servers where JIT makes more sense (sometimes)
Minecraft was rewritten in C++ to increase performance on lower end devices and overall general performance (no longer need to warmup JVM to remove the stutters during gameplay, lower downtime for restarts in realm based servers)
https://old.reddit.com/r/Minecraft/comments/i27zzo/5_ways_th...
We can talk all day about high/low level languages, JIT/GC introduce overhead, that's it
When you only have 8ms for your framebudget at 120hz, every bit make the difference
The rest is handled on the GPU anyways, AOT compiled ;)
No that is cheating, IL2CPP is a C# to C++ transpiler.. Which is similar to writing a C++ program, interesting technology though. However it's true Unity also has a Burst compiler which is AOT is release mode and output LLVM IR. Look that is interesting and that is exactly where I wanted the conversation to go. GraalVM is generally slower on AOT than on JIT. I expect the same from .NET 7 AOT (haven't checked but is likely true) Unity Burst is interesting because it leverage an infrastructure that has received an enormous number of human resources and optimizations for AOT (LLVM). However Unity does not allow to benchmark Burst vs modern .NET JIT so it's very possible that Burst is in many cases slower than .NET JIT. This can't be verified easily and I'm not aware if Burst can be used outside of Unity but I guess one could write the same microbenchmark for both, it's just that no-one did it. However, Unity has gained a lot of technical debt because its own tooling (and Mono) are stuck on .NET 4.x They are apparently actively seeking to update their support and will leverage CoreCLR to some extent so maybe once it will be done, comparisons will become easier and they might or not replace Burst by regular CoreCLR, time will tell. https://forum.unity.com/threads/gdc-2022-the-future-of-net-a... https://forum.unity.com/threads/net-6-support.1059992/
> Minecraft was rewritten in C++ C++ is faster because it is lower level, my point is Minecraft do not use Java AOT. and as said many of minecraft stutters are avoidable GC pauses.
It's true 8ms is a tight budget indeed hence why ZGC is a key advance, a place where C# is currently inferior to java.
> The rest is handled on the GPU anyways, AOT compiled Haha nice try, I appreciate the tentative but I'm not sure you're being right. regarding the topic of compiling shaders for a 2D GUI, using a JIT is a key advantage, see e.g. https://github.com/blend2d/blend2d As for GPU drivers (handling openGL/etc) I think its a mix of both but I have forgotten the things I had read about them on phoronix Most game emulators strongly benefit from JITs shaders too.
C++/CLI is slower than normal C++.
Of course, sometimes JIT is faster. I remember gcj compiled code was plenty of times slower than code running under JVM.
I think there is no easy way to conclude which is faster, AOT or JIT.
Garbage collection also takes its toll. Looking at most benchmarks Go which is AOT compiled does not fare better than JIT-ed C# or Java.
For .NET I suspect there won't be much difference speedwise between AOT and JIT.
But AOT vs JIT has some other aspects. Like with Blazor who, at first, ran under a .NET virtual machine which ran under WebAssembly Virtual Machine. With AOT, things are simpler.
1) IIRC CLI is managed AKA garbage collected (BTW managed C++ is common practice e.g. chromium) 2) human resources, c++/cli has received much less optimization effort than LLVM/GCC/C#
as for Java https://github.com/oracle/graal/issues/1069#issuecomment-473... Go is the proof that GC-ed languages can be fast via AOT so it is not the discriminating factor. I suspect C++ with a GC is not much faster than JITed C# and the rest would be explained by other language brittleness such as e.g. the vtable hell, monomorphisation, etc Also weirdly, LLVM and GCC have received much more optimization human resources than openjdk and coreclr
> But AOT vs JIT has some other aspects. Like with Blazor who, at first, ran under a .NET virtual machine which ran under WebAssembly Virtual Machine. With AOT, things are simpler. well yes for this special case
CLI compiles to MSIL and runs on the CLR, so yes, very managed by default.
> c++/cli has received much less optimization effort than LLVM/GCC/C#
C++/CLI also found no regular users and people have been warned not to use it from even just months after its original release. From certain perspectives: It has really only had the one release in 17 years and been a "legacy tool" for most of that time.
(Possibly two releases if you count C++/CX, though that doesn't run on the CLR and is its own weird one-off thing for COM weirdness.)
Are we using two weights here?