SkeLLLa / fastify-metrics

Prometheus metrics exporter for Fastify
https://savelife.in.ua/en/donate-en/
MIT License
96 stars 33 forks source link

Performance optimizations #67

Open kibertoad opened 1 year ago

kibertoad commented 1 year ago

Having encountered performance degradation after introducing fastify-metrics, we've attempted doing some of the obvious performance optimizations.

Here are the results (benchmarks included): https://github.com/kibertoad/fastify-prometheus-nitro/pull/1

I'm not sending PR as-is because it is pretty intrusive, but I can replicate same or all of it in original repo if perf increase seems significant enough for you, and changes acceptable.

SkeLLLa commented 1 year ago

Hi, since this plugin provide some utility functions the less if affects app performance, better it becomes. So any performance improvements are more than welcome.

kibertoad commented 1 year ago

Awesome, I'll try to make a set of incremental PRs then.

kibertoad commented 1 year ago

@SkeLLLa PR is up!