Skip to content

metrics: metrics_local: Remove key argument to optimize performance#3473

Merged
cosmo0920 merged 1 commit into
fluent:masterfrom
cosmo0920:optimize-metrics-plugins
Jul 30, 2021
Merged

metrics: metrics_local: Remove key argument to optimize performance#3473
cosmo0920 merged 1 commit into
fluent:masterfrom
cosmo0920:optimize-metrics-plugins

Conversation

@cosmo0920

Copy link
Copy Markdown
Contributor

Signed-off-by: Hiroshi Hatake hatake@calyptia.com

Which issue(s) this PR fixes:
Folows up #3440

What this PR does / why we need it:
This is because our use cases doesn't need key for distinguish plugins
and agents.
One of the use cases to specify plugin_id calling has a possibility to become the bottleneck for performance.
The reason is Kernel#instance_variable_defined? method is relatively
heavy operation.

Docs Changes:

No needed.

Release Note:

Same as title.

This is because our use cases doesn't need key for distinguish plugins
and agents.
One of the use cases to specify plugin_id calling has a possibility to become the bottleneck for performance.
The reason is Kernel#instance_variable_defined? method is relatively
heavy operation.

Signed-off-by: Hiroshi Hatake <hatake@calyptia.com>
@cosmo0920 cosmo0920 requested review from ashie and kenhys July 28, 2021 07:20
@cosmo0920 cosmo0920 self-assigned this Jul 28, 2021
@kenhys

kenhys commented Jul 29, 2021

Copy link
Copy Markdown
Contributor

I was just curious about it, how much performance is improved by this PR?

@cosmo0920

Copy link
Copy Markdown
Contributor Author

I was just curious about it, how much performance is improved by this PR?

For synchronous output plugin case, 2x faster than the previous implementation.
For buffered/asynchronous buffered case, 10% faster at the maximum which depends on batch operation frequency, I think.

@cosmo0920 cosmo0920 merged commit 7671d77 into fluent:master Jul 30, 2021
@cosmo0920 cosmo0920 deleted the optimize-metrics-plugins branch July 30, 2021 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants