News for hackers. Stuff that matters.
Re:Why Is JRuby Slow? by saurik on Saturday May 29, 2021 @08:07AM (#27324720)
The way Android solved this problem (before they implemented AOT) was to fork the JVM post-load (and I think even JIT) of all the core Java and Android classes; the real somewhat-fundamental problem with the JVM in a multi-process system isn't really having to "load the virtual machine and JIT for every process start" but the multiple, almost-certainly-uncoordinated garbage collectors.

http://www.cydiasubstrate.com/id/727f62ed-69d3-4956-86b2-bc0...

Re:Why Is JRuby Slow? by pjmlp on Saturday May 29, 2021 @01:54PM (#27326983)
They still use zygote, however as expected, cheap Android devices aren't the best hardware to run an AOT compiler, so with Android 7 they introduced a multitier execution, with interpreter hand written in Assembly, JIT compiler and AOT that take advantage of PGO data.

The AOT compiler only runs when the device is idle.

Starting with Android 10, they introduced a mechanism to upload PGO data into the store, so that when an APK is installed, if such data is already available the JIT/AOT don't have to relearn everything from scratch regarding the application.

https://source.android.com/devices/tech/dalvik/jit-compiler

They also improved the GC several times, the latest generation is quite good,

https://source.android.com/devices/tech/dalvik/gc-debug

There are several Google IO talks about how they went through this.