Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
RailsConf 2019 - Pre-evaluation in Ruby by Kevin Deisz _______________________________________________________________________________________________ Cloud 66 - Pain Free Rails Deployments Cloud 66 for Rails acts like your in-house DevOps team to build, deploy and maintain your Rails applications on any cloud or server. Get $100 Cloud 66 Free Credits with the code: RailsConf-19 ($100 Cloud 66 Free Credits, for the new user only, valid till 31st December 2019) Link to the website: https://cloud66.com/rails?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 Link to sign up: https://app.cloud66.com/users/sign_in?utm_source=-&utm_medium=-&utm_campaign=RailsConf19 _______________________________________________________________________________________________ Ruby is historically difficult to optimize due to features that improve flexibility and productivity at the cost of performance. Techniques like Ruby's new JIT compiler and deoptimization code help, but still are limited by techniques like monkey-patching and binding inspection. Pre-evaluation is another optimization technique that works based on user-defined contracts and assumptions. Users can opt in to optimizations by limiting their use of Ruby's features and thereby allowing further compiler work. In this talk we'll look at how pre-evaluation works, and what benefits it enables.
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the talk 'Pre-evaluation in Ruby' presented by Kevin Newton at RailsConf 2019, the speaker delves into the topic of optimizing Ruby's performance through a compelling method called pre-evaluation. The discussion opens with a brief overview of the challenges Ruby faces in optimization due to its features designed for flexibility, which often sacrifice performance. The talk highlights several key points: - **Understanding Compilers**: Newton begins by detailing how Ruby's compiler functions, including processes like lexical analysis, semantic analysis, and instruction generation. He provides a simple analogy using English sentences to explain how compilers break down and analyze code. - **Optimization Techniques**: The speaker introduces optimization techniques available in Ruby, emphasizing the limitations imposed by monkey-patching and binding inspection, which can hamper performance improvement initiatives. - **Pre-Evaluation Methodology**: Pre-evaluation emerges as a unique optimization technique that allows developers to define contracts and assumptions, which helps in streamlining the compilation process. This method enables users to temporarily opt-out of certain Ruby features to facilitate optimizations. - **Practical Examples**: Deisz shares tangible code examples, demonstrating how leveraging pre-evaluation can optimize arithmetic calculations and other operations, reminding the audience that while Ruby inherently supports flexibility, optimized coding practices can lead to more efficient execution. - **Introducing Preval Gem**: A critical aspect of the talk is the introduction of the 'preval' gem, which assumes developers will not engage in irresponsible coding practices (like monkey-patching) and thus can perform optimizations that the compiler might otherwise avoid. - **Call for Better Compiler Practices**: Deisz concludes with broader reflections on the intersection of coding practices and compiler optimization, arguing for a future where compilers handle more of the heavy lifting in optimizing code, thus alleviating developers from constant concerns over syntax and style rules. Overall, Deisz emphasizes finding a balance between Ruby's flexibility and the need for improved performance. The talk encourages Ruby developers to embrace pre-evaluation as a viable method for enhancing the efficiency of their applications without compromising the language's inherent advantages.
Suggest modifications
Cancel