Summary
In this chapter, you learned all about optimization in Ruby. You learned that you should only optimize if you have identified a bottleneck in your application. You learned that you should profile and benchmark a specific use case before attempting to optimize the use case, so you can test that your optimization actually improved performance. Next, you learned that the best way to improve performance is by running the least amount of code possible. Finally, you learned some techniques and tricks for optimizing when the profile output isn't helpful in alerting you to the cause of the performance issue in your library.
You've now finished Section 2 of the book, and are ready to move on to the final part of the book, which focuses on principles of Ruby web programming, starting with the most important part, the database. In the next chapter, we will learn why the database is crucial to the design of web applications.