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

Prevent CompositeMeter allocating on each record #3059

Merged
merged 1 commit into from Mar 17, 2022

Conversation

BrentDouglas
Copy link
Contributor

The way forEachChild was written mean each lambda has to close over the
argument which results in an allocation for each call. Instead we
slightly rewrite the forEachChild api to allow passing through the data
to each call so that the lambdas do not need to capture the argument.

@pivotal-cla
Copy link

@BrentDouglas Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link

@BrentDouglas Thank you for signing the Contributor License Agreement!

@BrentDouglas BrentDouglas force-pushed the record-alloc branch 2 times, most recently from ca5c8de to 70ec6f9 Compare March 9, 2022 10:52
@shakuzen shakuzen added module: micrometer-core An issue that is related to our core module performance Issues related to general performance labels Mar 10, 2022
@BrentDouglas
Copy link
Contributor Author

@shakuzen I updated this to avoid all the weird signatures and just return the iterable, seems a lot cleaner

@shakuzen shakuzen added this to the 1.9.0-M4 milestone Mar 17, 2022
The way forEachChild was written mean each lambda has to close over the
argument which results in an allocation for each call. Instead we
slightly rewrite the forEachChild api to allow passing through the data
to each call so that the lambdas do not need to capture the argument.
@shakuzen shakuzen changed the base branch from main to 1.7.x March 17, 2022 09:31
@shakuzen shakuzen modified the milestones: 1.9.0-M4, 1.7.10 Mar 17, 2022
Copy link
Member

@shakuzen shakuzen left a comment

Choose a reason for hiding this comment

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

Thanks. I've rebased onto 1.7.x so we can include this in patch releases.

@shakuzen shakuzen added the enhancement A general enhancement label Mar 17, 2022
@shakuzen shakuzen merged commit 10b76fd into micrometer-metrics:1.7.x Mar 17, 2022
@BrentDouglas BrentDouglas deleted the record-alloc branch March 22, 2022 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement module: micrometer-core An issue that is related to our core module performance Issues related to general performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants