go-graphite / carbon-clickhouse

Graphite metrics receiver with ClickHouse as storage
MIT License
187 stars 47 forks source link

Improve telegraf json receiver performance #127

Closed msaf1980 closed 1 year ago

msaf1980 commented 1 year ago

go test -benchmem -run=^$ -bench ^BenchmarkTelegrafHttpJson5 github.com/lomik/carbon-clickhouse/receiver

$ benchcmp json1.txt json2.txt 
benchmark                        old ns/op     new ns/op     delta
BenchmarkTelegrafHttpJson5-6     28932         13065         -54.84%

benchmark                        old allocs     new allocs     delta
BenchmarkTelegrafHttpJson5-6     157            140            -10.83%

benchmark                        old bytes     new bytes     delta
BenchmarkTelegrafHttpJson5-6     9592          10692         +11.47%