Skip to Content
Polished Ruby Programming
book

Polished Ruby Programming

by Jeremy Evans
July 2021
Intermediate to advanced
434 pages
8h 36m
English
Packt Publishing
Content preview from Polished Ruby Programming

Chapter 14: Optimizing Your Library

Optimization is often not needed in Ruby, but when it is needed, it should be approached in a principled manner, lest you waste time optimizing the wrong code. Nobody likes slow code, but there is a reason that premature optimization is considered the root of all evil.

In this chapter, you'll learn the importance of profiling in order to decide what to optimize, how the best optimization is deleting code or delaying the execution of code, and what to do when it looks like all parts of your application are slow.

We will cover the following topics in this chapter:

  • Understanding that you probably don't need to optimize code
  • Profiling first, optimizing second
  • Understanding that no code is faster than no code ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Ruby 3.3

Programming Ruby 3.3

Noel Rappin, Dave Thomas
The Ruby Programming Language

The Ruby Programming Language

David Flanagan, Yukihiro Matsumoto

Publisher Resources

ISBN: 9781801072724Supplemental Content