JIT issues relevant to realtime applications

I think Julia is basically what you want, but we have some work to do to make the GC and JIT behavior more latency-friendly, as well as changes to the compiler to make AOT compilation easier and faster:

GC improvements:

https://github.com/JuliaLang/julia/pull/41760 should reduce GC latency on multithreaded systems by making all threads cooperate during marking (the most expensive GC step).

Work on escape analysis in the compiler should eventually allow object finalizers to be run immediately at the end of a scope containing a non-escaping object, which should reduce issues with memory consumption for heap-allocated objects with attached finalizers.

https://github.com/JuliaLang/julia/pull/41616 will emit more GC safepoints, reducing stop-the-world latency for multithreaded programs, although further work is needed to improve this situation.

More GC generations could be added to reduce how many non-incremental GC passes need to be performed (as I understand it).

JIT improvements:

Multithreaded compilation should make it possible to minimize JIT latency on UI threads. I suspect this will be a very difficult PR, but will be endlessly beneficial.

Compiler improvements:

https://github.com/JuliaLang/julia/pull/41936 will allow the compiler and LLVM to be removed from PackageCompiler binaries which don’t require the JIT at runtime.

https://github.com/JuliaLang/julia/pull/40414 will make sysimage generation drastically faster, making it easier to iterate on PackageCompiler-generated binaries.

18 Likes