• Kamil Trzciński's avatar
    Reduce memory allocations for `StrongMemoize` · 31708fd9
    Kamil Trzciński authored
    Before this change the usage of `strong_memoize`
    resulted in using 4 gc slots (possibly with 4 mallocs)
    for each call.
    
    Depending on the data type a single memory allocation
    is enough. This with improved implementation
    results in 1.66x speedup.
    31708fd9
strong_memoize_spec.rb 2.66 KB