client_golang icon indicating copy to clipboard operation
client_golang copied to clipboard

Allocate constrain label values on stack, not heap for performance

Open AnshulMalik opened this issue 2 years ago • 1 comments

AnshulMalik avatar Mar 13 '24 07:03 AnshulMalik

Hey 👋 , pardon my ignorance, could you update your PR description mentioning how this change improves performance? I saw the title mentions that we're now allocating label values on the stack instead oh the heap, but I couldn't understand why that happens.

Does it make sense to share a pprof profile or benchmarks?

ArthurSens avatar Mar 15 '24 11:03 ArthurSens

Hey, this PR accomplishes similar thing, I'll close the PR now. https://github.com/prometheus/client_golang/pull/1272

AnshulMalik avatar Mar 20 '24 10:03 AnshulMalik