Please sign in to comment.
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.
- Loading branch information...
Showing with 5 additions and 2 deletions.