Ruby Rogues

RR 378: Ruby performance: MJIT with John Hawthorn


Listen Later

Panel: 
  • Charles Max Wood
  • David Richards
  • Dave Kimura
  • Eric Berry
Special Guests: John HawthornIn this episode of Ruby Rogues, the panel talks to John Hawthorn about MJIT. John has been a Ruby programmer for about 9 years and is based in Victoria, B.C. They talk about what MJIT is, the effects you can see from using the MJIT compiler, and why the JIT doesn’t always work with other languages. They also touch on how you can use the JIT in your own code, how he makes his performance better, and more!Show Topics:1:36 – John is a Ruby programmer, and has been one for the past 9 years, and he is based out of Victoria, B.C.5:00 – He had always been curious how a JIT would work and found that it was always too difficult to work with. Since discovering MJIT, he has been able to work with these compilers because he understands how to work with C code.7:36 – Ruby has a bytecode and it looks a lot like an assembly language, which is approachable to a Rubyist.8:24 – The core of MJIT is an ERB template which take this bytecode, loops over it, and emits C code.9:01 – Effects that you can seem from the JIT in your own code is that it uses a really tight math loop, making your code faster.11:25 – Other languages aren’t suited for compilers like JIT because they are so flexible to begin with. And in some cases, it doesn’t make sense to JIT compile.13:05 – The compiled code now is not reusable by other workers and works better with one compilation per process.15:20 – The temp folder gets cleared immediately after its run, but this compiled code is probably going to stay in memory forever.17:30 – The MJIT doesn’t work as well with Rails because the code can’t get warmed up enough. Some things aren’t friendly to a JIT.20:24 – If someone wants to play with the JIT, as long as you have any Ruby version manager, install any of the previewed releases of 2.6 and then run with --jit.21:44 – Online, you can look into following people who have written various Ruby libraries to look at performance. You can look at people like Sam Saffron and Julia Evans.23:57 –TruffleRuby is a new front-end on top of a mature virtual machine whereas MJIT is a brand new virtual machine on top of a Ruby front-end.27:57 – The MJIT had no effect on his work, it was just really fun and interesting to look into.28:29 – To make his performance better, he allocates fewer objects, does less loops, and writes better queries.29:02 – You want to run a profiler that will give you a better idea of where to look for performance issues, but you really need a proper benchmark to say what is wrong with your performance. A great benchmark you can use is benchmark-ips.31:59 – The “gotcha” of doing this kind of work is verifying that you’ve actually improved it.33:41 – Before we have the JIT in production, we are going to be using these techniques to find out if the JIT is helping us.Links:
  • Get a Coder Job Course
  • Ruby
  • MJIT
  • Playing with ruby's new JIT: MJIT by John Hawthorn
  • Rails
  • Bootsnap
  • Sam Saffron
  • Julia Evans
  • TruffleRuby
  • benchmark-ips
  • @jhawthorn
  • johnhawthorn.com
  • John’s GitHub
  •  
Sponsors
  • Sentry
  • Digital Ocean
  • Get a Coder Job Course
Picks:Charles
  • Iron Druid Chronicles by Kevin Hearne
  • Zoom
  • Notion
  • Eric Begay
Dave
  • Sony WH-1000XM2
  • Ryobi Bench Sander
David
  • Stephen Fry in America
Eric
  • Remote for Slides
  • Zoom
John
  • Julia Evans Blog Posts
  • Celeste
Special Guest: John Hawthorn.

Advertising Inquiries: https://redcircle.com/brands

Privacy & Opt-Out: https://redcircle.com/privacy

Become a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.
...more
View all episodesView all episodes
Download on the App Store

Ruby RoguesBy Charles M Wood

  • 3.4
  • 3.4
  • 3.4
  • 3.4
  • 3.4

3.4

21 ratings


More shows like Ruby Rogues

View all
Software Engineering Radio - the podcast for professional software developers by se-radio@computer.org

Software Engineering Radio - the podcast for professional software developers

272 Listeners

The Changelog: Software Development, Open Source by Changelog Media

The Changelog: Software Development, Open Source

283 Listeners

JavaScript Jabber by Charles M Wood

JavaScript Jabber

235 Listeners

iPhreaks by Charles M Wood

iPhreaks

17 Listeners

Ruby Rogues by Charles M Wood

Ruby Rogues

45 Listeners

The Freelancers' Show by Charles M Wood

The Freelancers' Show

23 Listeners

The Ruby on Rails Podcast by Elise Shaffer

The Ruby on Rails Podcast

53 Listeners

Adventures in Angular by Charles M Wood

Adventures in Angular

33 Listeners

The Bike Shed by thoughtbot

The Bike Shed

121 Listeners

Software Engineering Daily by Software Engineering Daily

Software Engineering Daily

625 Listeners

React Native Radio by Jamon Holmgren, Robin Heinze, Mazen Chami

React Native Radio

59 Listeners

Soft Skills Engineering by Jamison Dance and Dave Smith

Soft Skills Engineering

269 Listeners

My JavaScript Story by Charles M Wood

My JavaScript Story

4 Listeners

JavaScript Jabber by Charles M Wood

JavaScript Jabber

61 Listeners

Adventures in Angular by Charles M Wood

Adventures in Angular

15 Listeners

Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

Syntax - Tasty Web Development Treats

983 Listeners

REWORK by 37signals

REWORK

211 Listeners

Remote Ruby by Chris Oliver, Andrew Mason

Remote Ruby

34 Listeners

Maintainable by Robby Russell

Maintainable

32 Listeners

The Stack Overflow Podcast by The Stack Overflow Podcast

The Stack Overflow Podcast

64 Listeners

Code and the Coding Coders who Code it by Drew Bragg

Code and the Coding Coders who Code it

6 Listeners

Rooftop Ruby Podcast by Collin Donnell, Joel Drapper

Rooftop Ruby Podcast

3 Listeners

IndieRails by Jess Brown & Jeremy Smith

IndieRails

5 Listeners

Dead Code by Jared Norman

Dead Code

0 Listeners