tarantool / metrics

Metric collection library for Tarantool
MIT License
39 stars 23 forks source link

perf: 100x increases speed for collectors/counter if used without label #358

Closed ochaton closed 2 years ago

ochaton commented 2 years ago

jitable counter:inc and counter:set if no labels used

I didn't following:

ochaton commented 2 years ago
tarantool -l clock -l metrics -l fun -l jit -e 'counter = metrics.counter("fast_counter")' -i
Tarantool 2.10.0-beta2-368-gfea8c8e40

On master branch

tarantool> clock.bench(function() return fun.range(1, 1e7):map(function(t) counter:inc(1) return t end):length() end)
---
- - 3.367997
  - 10000000
...

On perf/v.grubov branch

tarantool> clock.bench(function() return fun.range(1, 1e7):map(function(t) counter:inc(1) return t end):length() end)
---
- - 0.028591
  - 10000000
...