惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - 聂微东
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
L
LangChain Blog
I
InfoQ
T
Tailwind CSS Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
Vercel News
Vercel News
雷峰网
雷峰网
量子位
A
About on SuperTechFans
Martin Fowler
Martin Fowler
H
Help Net Security

Ruby on Rails: Compress the complexity of modern web apps

Safer to_i coercion, custom to_fs formats, and more! This Week in Rails: May 16, 2026 This Week in Rails: May 8, 2026 This Week in Rails: May 1, 2026 Active Record gets better every week Great big Rails World 2026 update: CFP, Corporate Support tickets, workshops Query command for database queries and more Explicit query: and body: kwargs for integration tests and more! Speedup ActiveRecord::LogSubscriber#sql_color and more! This Week in Rails: March 27, 2026 Rails Versions 8.0.5 and 8.1.3 have been released! Rails Versions 7.2.3.1, 8.0.4.1, and 8.1.2.1 have been released! This Week in Rails: March 20, 2026 Validate URI scheme in Action Text and more This Week in Rails: March 6, 2026 Planning Center is the newest Rails Foundation Contributing member Action Text gets Markdown conversion, editor links in devcontainers, and more! BARRA seeks Rails developer Joe Agliozzo is looking for a Rails developer The rise of lighttpd as the alternative web server When longer is better and more is more Snowdevil: First e-tailer on Rails Natural selection for frameworks in Ruby vs Java Address book tutorial in Portuguese Becoming a better programmer with Rails 10 Things Every Java Programmer Should Know About Ruby Really Getting Started in Rails Off the Treadmill, Onto the Rails Rails 0.9.5: A world of fixes and tweaks Rich clients with Rails and XUL
Feeling the slowdown blues after going 0.13?
David Heinemeier Hansson · 2005-07-08 · via Ruby on Rails: Compress the complexity of modern web apps

Friday, July 8, 2005
Posted by admin

It’s somewhat ironic that we heralded Rails 0.13 as being a great move forward for the performance of Rails and then half the threads on the mailing list is about “Rails is sLOOOW!”. We’ve found the problems, though.

The first was with the MySQL/Ruby bindings, which called GC.start whenever MySQL#free was called. And we just put in MySQL#free in 0.13 to improve things after each select of rows. This caused the garbage collector to run every time you selected something. Doh!

The C-bindings didn’t have this problem, so it wasn’t discovered by the core team right away, and that was posed as the solution on the mailing list. Unfortunately, it’s not necessarily trivial to compile native bindings on all platforms (notably Windows), so having fast Ruby bindings was indeed important. They’re fast again, but if you upgraded to the C-bindings you can be happy that you’re even faster.

The second problem was that we plugged a big memory leak in development mode, but doing so caused a total of 8 runs through the so-called ObjectSpace after each action (basically iterating over all objects in the interpreter 8 times, eeks!). On big applications this could take a while. On Basecamp it took 2 seconds. After the fix went in where we just traverse the ObjectSpace once, it’s down to a comfortable 0.2 seconds (which is about 0.17 faster than it even was before the memory leak fix!).

Thus, Rails 0.13.1 is near forth coming. As in this weekend. If you cannot wait, and we certainly won’t blame you, there are new beta gems that consist purely of bug fixes. Upgrade with gem install rails --source http://gems.rubyonrails.org --include-dependencies.