diff options
| author | Jeremy Kemper <jeremy@bitsweat.net> | 2013-12-12 18:40:21 -0700 |
|---|---|---|
| committer | Jeremy Kemper <jeremy@bitsweat.net> | 2013-12-12 18:53:32 -0700 |
| commit | b474d06d5ea646c8145b07c8acbf1181c9e0b2aa (patch) | |
| tree | d51b795e6d73b4c1c44c466ceda4a7463520ba40 /guides/code | |
| parent | 17922930c384e22bb4b37523b1b5f4db2137c134 (diff) | |
| download | rails-b474d06d5ea646c8145b07c8acbf1181c9e0b2aa.tar.gz rails-b474d06d5ea646c8145b07c8acbf1181c9e0b2aa.tar.bz2 rails-b474d06d5ea646c8145b07c8acbf1181c9e0b2aa.zip | |
Perf: save ~9% of object allocations on heavy requests.
The per-thread registry is keyed on the class name, and each request for
the class name returns a new string. This is in the hot path for a lot
of Active Record behavior, so we easily accumulate thousands of repeated
strings.
To fix, we simply cache the key when the class is first extended with
the module.
TODO: Eliminate this module. The per-thread instance concept is common,
but this technique confuses and obfuscates.
Diffstat (limited to 'guides/code')
0 files changed, 0 insertions, 0 deletions
