Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[improve][fn] Optimize string concatenation in user metrics gen #20499

Merged

Conversation

michaeljmarshall
Copy link
Member

Motivation

Minor optimization for metrics generation in functions. String concatenation is faster than string format. This is valuable in the context of metrics where we can generate many strings in a tight loop.

Modifications

  • Replace String.format with string concatenation in several locations.
  • Only create metrics prefix once.

Verifying this change

This change is a trivial rework / code cleanup without any test coverage.

Documentation

  • doc-not-needed

@michaeljmarshall michaeljmarshall added this to the 3.1.0 milestone Jun 5, 2023
@michaeljmarshall michaeljmarshall self-assigned this Jun 5, 2023
Copy link
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@michaeljmarshall michaeljmarshall merged commit b1822ed into apache:master Jun 5, 2023
@michaeljmarshall michaeljmarshall deleted the improve-metrics-gen-func branch June 5, 2023 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/function doc-not-needed Your PR changes do not impact docs ready-to-test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants