(JVM) • Ruby implementation fi rst, JVM language second • Many bene fi ts from JVM ecosystem • Ruby code should "just work" • Different extension API, no forking, parallel threads • Thousands of production users, 17 years of real-world use
LogStash: you probably have already used it • Datek: point-of-sale, airplane refueling terminals, ad kiosks • Looker: business analytics platform from Google • Kinetic Data: business portal and automation platform • Let us know if you use JRuby!
Native JIT (JRuby was the fi rst JIT for Ruby) • Optimizes your whole application • Monitoring and pro fi ling tools (many choices, most are Free) • Deploy anywhere (single fi le, obfuscated code, sell your app!) • Thousands of JVM developers making it better
concurrency) 0rps/mb 0.45rps/mb 0.9rps/mb 1.35rps/mb 1.8rps/mb 1.72 rps/MB 0.92 rps/MB 0.8 rps/MB CRuby CRuby + YJIT JRuby 300MB heap One JRuby process can run your entire site
Java 17 (or 21) minimum • New Prism parser with complete language features • Targeted optimization across the board • Our biggest jump since JRuby 9000 (9.0.0.0) • Releasing late this year...now is the time to contribute!
and Prism (new C-based) • Future is Prism by default • Ship native library for most platforms • Ship WASM build that runs on JVM without native code • Prism already integrated in JRuby 9.4!
that called them • __method__/__callee__ look at method's name • block_given? needs passed block • JVM does not let us access caller dierectly (security etc) • Copying data to heap is slow and breaks optimization • Optimized: pass caller data to special call sites
fi ne a new "instruction" • Write code to connect call site to instruction logic • JIT optimizes like static JVM bytecode • Most JRuby optimizations use InvokeDynamic
kind 0x6 : INVOKESTATIC org/jruby/ir/targets/indy/FrameNameSite.frameNameBootstrap(Ljava/lang/invoke/MethodH // arguments: "-e", 1 ] Load method name on stack Special call to name-aware instruction FrameNameSite calls frameless __callee__ with name or makes normal method call
Pro fi le to pick "right size"? • Static strings copy directly into buffer • "Appendable" objects copy directly into buffer • Only non-String objects create temporary strings
Read-only closure variables passed on stack • Block-receiving methods inlined with block • Smarter object shapes for instance variables, strings, arrays • Inline super calls, re fi nements, metaprogramming, and more • JRuby 10 will be faster and warm up more quickly!
• Enumerators use fi bers • Structured concurrency is coming • Loom brings fi bers to JVM • Easily handles thousands of fi bers • Faster context-switching • Working with @ioquatix on async
With JVM help to make direct calls • Foreign memory API • JVM-assisted access, lifecycle • Make FFI calls as fast as C ext • Time to get rid of C extensions! • Generate Panama FFI, call from Ruby, better than writing C!
design • Project CRaC: checkpoint and restore (Linux-only) • Snapshot a warm JRuby and jump back in • Project Leyden: ahead-of-time optimization for OpenJDK • Early access builds are promising! • JVM JIT server: start with JIT code from previous run
me keep building JRuby • Publicity for you or your company! • Commercial JRuby support now available • Contact [email protected] • Let us know how we can help you!