elide
elide copied to clipboard
Performance enhancements
The following performance enhancements are imagined or planned (modulo testing to validate):
-
[x] Concurrent JS execution. Currently, the JS VM operates in a single thread. We should make it multi-threaded with proper synchronization a-la this sample. Done right, this could easily double/triple JS execution throughput.
-
[x] PGO (Profile Guided Optimization). PGO can close the gap between native binary peak performance and JVM warmed-JIT peak performance. Ideally this could be rolled into the Gradle plugin based on an app's testsuite (along with agent instrumentation for reflection). Oracle reports this as the most impactful performance option for GraalVM native apps.
-
[ ] Hermetic inputs. By fully understanding inputs to SSR executions, and controlling the surrounding environment, it may be possible to do intelligent things with caching and streaming.
-
[ ] Streamed responses. Currently, HTML content is buffered before being sent to the invoking client; this is particularly true of the JS VM. If responses were fully streamed, the browser would receive resources earlier, and would therefore be able to begin downloading resources earlier, improving perceived performance. This would also lay the ground-work for techniques like those adopted by Turbo (i.e. WebSocket-based streaming of HTML).
-
[x] Fully-static images. By creating smaller Docker images which function in a completely standalone fashion (i.e.
FROM scratch
), maybe the resulting apps use less memory and are therefore lighter/faster at runtime. Remains to be seen.