This is an experiment to pre-train and AOT enough of JRuby to get startup time for "gem list" down to a reasonable speed. I've tried various combintions and so far this seems to be the best, but the timings are highly variable.
Step 1: Perform a gem list while dumping IR. This saves the compiled IR for all loaded files to disk, to skip parsing and compiling in future runs.
jruby --dev -Xir.writing -S gem list > /dev/null
Step 2: Train AOT by running the following script repeatedly with the given JRuby arguments. Requires a small JRuby patch because IR reading breaks for any script has not been written (like the training script).