jnunemaker/mongomapper — pull request #457 by cheald (2012-09-28 06:53:49+00:00)
Title: Performance fixes

I spent an evening with kcachegrind and a fairly large production application and was able to find a number of micro-optimizations that make a pretty big difference in aggregate. While the methods I touched are all small and fast, they're called tens of thousands of times per page, which adds up rather quickly.

The core approach is to eliminate extraneous method calls and string allocations, and to cache non-changing values where appropriate rather than computing them over and over.

These changes resulted in a ~20% speed boost to my overall app, as measured by ruby-prof.