equalizer
equalizer copied to clipboard
Private `#hash` method is slow
Heya, thanks for equalizer!
Was debugging a performance issue today and noticed that ~25% of the request time was taken up by repeated calls to equalizer's #hash
method when I was using an equalized value object as a hash key. It also appears that ~60% of that ~25% was calling #to_proc
on method(:send)
, so caching the proc'ed send in a constant or something may help. As a comparison, switching to using a stringified version of my value object as the hash key was relatively free... i.e. subsequent requests sped up by ~25%.
Not a deal breaker, just a heads-up. Attached a screenshot of the flamegraph in case it helps.