Skip to content
  • Jeremy Kemper's avatar
    b474d06d
    Perf: save ~9% of object allocations on heavy requests. · b474d06d
    Jeremy Kemper authored
    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.
    b474d06d
    Perf: save ~9% of object allocations on heavy requests.
    Jeremy Kemper authored
    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