RR 378: Ruby performance: MJIT with John Hawthorn episode artwork

EPISODE · Sep 4, 2018 · 44 MIN

RR 378: Ruby performance: MJIT with John Hawthorn

from Ruby Rogues · host Charles M Wood

Panel: Charles Max WoodDavid RichardsDave KimuraEric 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 CourseRubyMJITPlaying with ruby's new JIT: MJIT by John HawthornRailsBootsnapSam SaffronJulia [email protected]’s GitHub SponsorsSentryDigital OceanGet a Coder Job CoursePicks:CharlesIron Druid Chronicles by Kevin HearneZoomNotionEric BegayDaveSony WH-1000XM2Ryobi Bench SanderDavidStephen Fry in AmericaEricRemote for SlidesZoomJohnJulia Evans Blog PostsCelesteSpecial Guest: John Hawthorn. Advertising Inquiries: https://redcircle.com/brandsPrivacy & Opt-Out: https://redcircle.com/privacyBecome a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.

Panel: Charles Max WoodDavid RichardsDave KimuraEric 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 CourseRubyMJIT<a...

NOW PLAYING

RR 378: Ruby performance: MJIT with John Hawthorn

0:00 44:24

No transcript for this episode yet

We transcribe on demand. Request one and we'll notify you when it's ready — usually under 10 minutes.

JFK The Enduring Secret Jeff Crudele An in depth tutorial and discussion around the assassination of John F. Kennedy, (JFK) the country's 35th president who was brutally murdered in Dallas Texas on November 22, 1963. The series comprehensively explores the major facts, themes, and events leading up to the assassination in Dealey Plaza and the equally gripping stories surrounding the subsequent investigation. We review key elements of the Warren Commission Report , and the role of the CIA and FBI. We explore the possible involvement of the Mafia in the murder and the review of that topic by the government's House Select Committee on Assassinations in the 1970's. We explore the Jim Garrison investigation and the work of other key figures such as Mark Lane and others. Learn more about Lee Harvey Oswald the suspected killer and Jack Ruby the distraught Dallas night club owner with underworld ties and the man that killed Oswald as a national TV audience was watching. Stay with us as we take you through the facts and theorie Explicit 暗黑森林 The Dark Forest 榮忠豪/Ruby 盧春如/Joanna Wang 王若琳 社會總是希望人人都活在明亮。但一旦人的黑暗面露出的時候,社會會怎麼反應? 人性的黑暗總是被壓抑的而不被允許顯露, 但若這些邪惡的行為無法被壓下來 會有什麼事情發生? 本播客想透過真實殺人案件與其他暗黑的故事來探索人的黑暗面,但就像暗黑的森林,在黑暗的樹枝之中還是看得到光芒,提醒人們黑暗之處還是有希望的存在。 除了只關注故事的黑暗,『暗黑森林』也會專注在人們對於彼此的關懷,同情,與自我保護的重要性。來吧!跟著主持人 榮忠豪/Joanna 王若琳/Ruby 盧春如 一起走進 「暗黑森林」 Powered by Firstory Hosting Explicit Rogues Gallery 27th Letter Productions Kristen, M.J., and Chris investigate pop culture's most memorable villains, antiheroes, and misunderstood monsters to find out how they make being bad look so good. New episodes every other Thursday. Explicit Ruby Ryder – Pegging Paradise Ruby Ryder Your guide for pegging, anal sex, and bdsm Explicit

Frequently Asked Questions

How long is this episode of Ruby Rogues?

This episode is 44 minutes long.

When was this Ruby Rogues episode published?

This episode was published on September 4, 2018.

What is this episode about?

Panel: Charles Max WoodDavid RichardsDave KimuraEric 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....

Can I download this Ruby Rogues episode?

Yes, you can download this episode by clicking the download button on the episode player, or subscribe to the podcast in your preferred podcast app for automatic downloads.
URL copied to clipboard!