equalizer icon indicating copy to clipboard operation
equalizer copied to clipboard

Private `#hash` method is slow

Open botandrose opened this issue 9 years ago • 0 comments

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.

screenshot from 2015-12-01 17 42 59

botandrose avatar Dec 02 '15 01:12 botandrose