A status update on JRuby, covering compatibility, Rails, and next-gen performance numbers. JRuby is currently the fastest way to run Rails apps, and we're doing work to make it even faster in the future.
I brought some American craft beers to give away! • Try running something on JRuby, show me, and take your pick: • Bender: oatmeal brown ale • Furious: dark American IPA • Foggy Geezer: New England IPA
compatible, if something's broken tell us • Supports pure-Ruby gems, many extensions • We want to be a Ruby first! • It's a JVM language • Full access to the power of the JVM platform!
Modulo a few things we couldn't finish • You won't notice unless you use some weird edge features • Primary focus is always on compatibility and experience • Performance comes along later
opportunities to contribute! • Learn more about how Ruby and JRuby work! • Help us keep up with Ruby development! • Profit! • We are always standing by on IRC, Gitter, Twitter to help you
while, gathering information • Just-in-time (JIT) compiler compiles hot code to JVM • JVM turns that into optimized native code • Heavy dependence on JVM to optimize well • Newer JVM JITs showing great promise!
Practically useless • Like judging a person by how much they can bench press • JRuby has won microbenchmarks for years, never faster on Rails • Easier to isolate specific measurements • Great for exploring new runtimes and tech
JVM see through all the dynamic bits of Ruby • Added in Java 7, with much input and testing from JRuby • Steadily improving performance, reducing overhead • -Xcompile.invokedynamic • May be default soon!
= 0 y = 0 while y < size ci = (2.0*y/size)-1.0 x = 0 while x < size zrzr = zr = 0.0 zizi = zi = 0.0 cr = (2.0*x/size)-1.5 escape = 0b1 z = 0 while z < 50
2006 • Almost as long as Rails has existed! • Thousands of JRoR instances around the world • JRuby 9000, Ruby 2.4, 2.5 work slowed down Rails support • Rails 5.0 not supported for at least a year • ActiveRecord suffered the most
No C extensions, no -devel packages, no headers or compiling • Rebooted last year to reduce maintenance hassle • 1:1 match with Rails versions (e.g. Rails 5.1 = ARJDBC 51.x) • SQLite3, MySQL/Maria, PostgreSQL • Sharing 90%+ of code with Rails
• Largest CPU consumer by far • Heavy object churn, GC overhead • Create, read, and update measurements • If delete is your bottleneck, we need to talk • CRuby 2.5.1 vs JRuby 9.2 on JDK10
threads, so we need processes • Processes inevitably duplicate runtime state • Much effort and lots of money wasted • JRuby is a great answer! • Multi-threaded single process runs your whole site
400-500MB versus 50MB • Ten CRuby processes = 500MB • Ten JRuby threads = 400-500MB • May need to tell JVM a memory cap • For 100-way or 1000-way...you do the math
-XX:+EnableJVMCI -XX:+UseJVMCICompiler • Put in JAVA_OPTS or prefix with -J at JRuby CLI • Download "GraalVM" as your JDK • Commercial product, but maybe that's your thing