Ruby Performance Optimization: Why Ruby is Slow, and How to Fix It (Paperback)
暫譯: Ruby 性能優化:為什麼 Ruby 會慢,以及如何修復它 (平裝本)

Alexander Dymo

  • 出版商: Pragmatic Bookshelf
  • 出版日期: 2015-12-29
  • 售價: $1,260
  • 貴賓價: 9.5$1,197
  • 語言: 英文
  • 頁數: 202
  • 裝訂: Paperback
  • ISBN: 1680500694
  • ISBN-13: 9781680500691
  • 相關分類: Ruby
  • 立即出貨 (庫存 < 3)

買這商品的人也買了...

相關主題

商品描述

You don't have to accept slow Ruby or Rails performance. In this comprehensive guide to Ruby optimization, you'll learn how to write faster Ruby code--but that's just the beginning. See exactly what makes Ruby and Rails code slow, and how to fix it. Alex Dymo will guide you through perils of memory and CPU optimization, profiling, measuring, performance testing, garbage collection, and tuning. You'll find that all those "hard" things aren't so difficult after all, and your code will run orders of magnitude faster.

This is the first book ever that consolidates all the Ruby performance optimization advice in one place. It's your comprehensive guide to memory optimization, CPU optimization, garbage collector tuning, profiling, measurements, performance testing, and more.

You'll go from performance rookie to expert. First, you'll learn the best practices for writing Ruby code that's easy not only on the CPU, but also on memory, and that doesn't trigger the dreaded garbage collector. You'll find out that garbage collection accounts for 80% of slowdowns, and often takes more than 50% of your program's execution time. And you'll discover the bottlenecks in Rails code and learn how selective attribute loading and preloading can mitigate the performance costs of ActiveRecord.

As you advance to Ruby performance expert, you'll learn how profile your code, how to make sense out of profiler reports, and how to make optimization decisions based on them. You'll make sure slow code doesn't creep back into your Ruby application by writing performance tests, and you'll learn the right way to benchmark Ruby.

And finally, you'll dive into the Ruby interpreter internals to really understand why garbage collection makes Ruby so slow, and how you can tune it up.

What You Need:

Some version of Ruby. The advice from this book applies to all modern Ruby versions from 1.9 to 2.2. 80% of the material will also be useful for legacy Ruby 1.8 users, and there is 1.8-specific advice as well.

商品描述(中文翻譯)

您不必接受緩慢的 Ruby 或 Rails 性能。在這本全面的 Ruby 優化指南中,您將學習如何編寫更快的 Ruby 代碼——但這僅僅是開始。您將清楚了解什麼使 Ruby 和 Rails 代碼變慢,以及如何修復它。Alex Dymo 將引導您穿越內存和 CPU 優化、性能分析、測量、性能測試、垃圾回收和調整的險境。您會發現所有那些「困難」的事情其實並不那麼難,您的代碼將運行得快上數個量級。

這是第一本將所有 Ruby 性能優化建議整合在一起的書籍。它是您關於內存優化、CPU 優化、垃圾回收器調整、性能分析、測量、性能測試等的全面指南。

您將從性能新手變成專家。首先,您將學習編寫對 CPU 和內存都友好的 Ruby 代碼的最佳實踐,並且不會觸發可怕的垃圾回收器。您會發現垃圾回收佔據了 80% 的性能下降,並且通常佔用您程序執行時間的 50% 以上。您還將發現 Rails 代碼中的瓶頸,並學習如何通過選擇性屬性加載和預加載來減輕 ActiveRecord 的性能成本。

隨著您進階成為 Ruby 性能專家,您將學習如何分析您的代碼,如何理解性能分析報告,以及如何根據這些報告做出優化決策。您將通過編寫性能測試來確保緩慢的代碼不會再次潛入您的 Ruby 應用程序,並學習正確的 Ruby 基準測試方法。

最後,您將深入 Ruby 解釋器的內部,真正理解為什麼垃圾回收使 Ruby 變得如此緩慢,以及如何進行調整。

您需要的:

某個版本的 Ruby。本書中的建議適用於所有現代 Ruby 版本,從 1.9 到 2.2。80% 的內容對於舊版 Ruby 1.8 用戶也會有用,並且還有針對 1.8 的特定建議。