conradludgate / measured

A better metrics crate
26 stars 3 forks source link

Update histograms/no_cardinality/metrics benchmark to use pre-resolved handle. #5

Closed tobz closed 4 months ago

tobz commented 4 months ago

For the aforementioned benchmark, this PR switches to using a pre-registered handle. Pre-registered handles are fairly common for super performance-sensitive use cases, so it's a no-brainer to use them when there's no dynamic labels involved... and will naturally be faster than re-registering the metric each time.

conradludgate commented 4 months ago

Ah, yeah. This is definitely fair. I'll leave this open to remind me to rerun the benchmarks and update accordingly. Thanks!

conradludgate commented 4 months ago

I've just noticed that the histogram benchmark accumulates a lot of nemory. I need to find a way to occasionally run https://docs.rs/metrics-exporter-prometheus/latest/metrics_exporter_prometheus/struct.PrometheusHandle.html#method.run_upkeep, otherwise I don't think the benchmarks is entirely fair.