<div dir="ltr"><div>Hey folks!</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>The benchmark just boots JRuby and loads a large library, requiring a lot of code to be parsed each time:</div><div><br></div><div>```</div><div>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 }'</div><div>```</div><div><br></div><div>Unscientific numbers I've gathered, with enough warmup to stabilize performance...</div><div><br></div><div>* Warm performance with tiered = 0.11s per iteration</div><div>* Warm performance without tiered = 0.021s per iteration</div><div><br></div><div>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.</div><div><br></div><div>I've seen a perf difference between tiered and untiered before, but never as bad as 5x worse. Please advise on next steps!</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Charles Oliver Nutter</b><div><i>Architect and Technologist</i></div><div>Headius Enterprises</div><a href="https://www.headius.com" target="_blank">https://www.headius.com</a><div><div><a href="mailto:headius@headius.com" target="_blank">headius@headius.com</a></div></div></div></div></div></div>