Poor performance with tiered compiler and Chicory WASM AOT

Charles Oliver Nutter headius at headius.com
Tue Jan 27 16:43:14 UTC 2026


Hey folks!

I'm looking at performance of a pretty unusual use case: the Prism Ruby
parser compiled to WASM and AOT compiled to JVM using Chicory.

We are exploring the use of Chicory WASM AOT for a ton of things lately due
to the Ruby community's frequent dependence on native libraries. We use
Chicory to ship a 100% functional JRuby even if there's native library
dependencies, but obviously we want those WASM-compiled libraries to
perform well.

My recent benchmarking has me running JRuby with Chicory AOT-compiled Prism
as its parser, and the performance difference between tiered and untiered
is shockingly different.

The benchmark just boots JRuby and loads a large library, requiring a lot
of code to be parsed each time:

```
jruby -Xparser.summary -Xparser.prism.wasm -e 'loop { t = Time.now; ruby =
org.jruby.Ruby.newInstance; ruby.loadService.require("rubygems");
ruby.tearDown; $stderr.puts Time.now - t }'
```

Unscientific numbers I've gathered, with enough warmup to stabilize
performance...

* Warm performance with tiered = 0.11s per iteration
* Warm performance without tiered = 0.021s per iteration

The set up is tricky because this is on an experimental branch of JRuby
that depends on experimental branches of two other projects, but I can make
a build of it available if there's interest. I'm also happy to publish
LogCompilation output or any other artifacts that would be useful.

I've seen a perf difference between tiered and untiered before, but never
as bad as 5x worse. Please advise on next steps!

*Charles Oliver Nutter*
*Architect and Technologist*
Headius Enterprises
https://www.headius.com
headius at headius.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-compiler-dev/attachments/20260127/2ec0516b/attachment.htm>


More information about the hotspot-compiler-dev mailing list