AppMetrics / InfluxDB

App Metrics Extensions for InfluxDB reporting
https://www.app-metrics.io/reporting/reporters/influx-data/
Apache License 2.0
17 stars 13 forks source link

Optimize perfs and allocations #46

Closed tbolon closed 5 years ago

tbolon commented 5 years ago

Hi,

We are using AppMetrics to send metrics to InfluxDB.

We have observed some places where performances can be enhanced (mostly regarding allocations).

I have created a branch to add benchmarks on this project (with the same structure as benchmarks in AppMetrics project). It will be used to detect any regression.

You can browse the changes in my fork.

For now, we have identified: (checked items are already fixed in my branch)

I have kept all previous classes to generate baseline benchmarks.

I tried to made these changes not too disturbing, and prevented code duplication when possible.

Our plan is to reduce further the cost of writing points to prevent as much as possible garbage collection. I hope you will find these change useful. If so, I will create a PR so you could review the changes in detail.

Regards,

alhardy commented 5 years ago

@tbolon sorry for the late reply, and thanks for taking the time.

Could you create a pull request please

tbolon commented 5 years ago

Yes, I am out of office until March 11th. I will create a PR when back.Thanks!

tbolon commented 5 years ago

I have created a PR and updated the issue.

All tests are green, and I will update the issue with a copy of the benchmark results soon.

Edit: you will have to wait tomorrow, since my laptop is not really benchmark friendly (my cpu is throttled) :(