metrics icon indicating copy to clipboard operation
metrics copied to clipboard

small performance regression when no recorder set in 0.22

Open rukai opened this issue 1 year ago • 1 comments

I've noticed some of my benchmarks that exercise code that happens to use metrics had a 30% performance regression when I updated metrics from 0.21 to 0.22. My solution to this was to set the benchmarks to always set a recorder, as previously they had no recorder set This makes sense in our case since in our application we always have metrics enabled anyway, so this was just more realistic. Once I did this I could observe no performance difference in the upgrade to 0.22

So personally this isnt causing me any issues. But I thought it worth mentioning in case this is something you care about.

rukai avatar Feb 08 '24 22:02 rukai

This is likely based on the structure of how we handle global vs local recorders.

There used to only be a single place we checked for the currently installed recorder, and that recorder was either the default no-op recorder or the installed global recorder.. which basically meant there was zero logic or anything, literally just a direct load of the recorder variable. Now we check to see if a local recorder has been set, and if not, we then fallback and check if a global recorder has been set.

What is the actual wall clock time represented by that 30%, though?

tobz avatar Feb 11 '24 12:02 tobz

Going to close this since there was never any more information and, based on the timing, likely related to the above, and thus inevitable and unavoidable

Thank you again for reporting it overall, though. :)

tobz avatar Apr 12 '24 12:04 tobz