Skip to content

[perf] Reduce allocations on some transport paths #5865

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

Merged
merged 2 commits into from
Jul 13, 2021

Conversation

stevejgordon
Copy link
Contributor

Lazily caches the Uri on RequestData since this property is accessed at least three times and each time was allocating a new Uri. This saves 192 bytes per request.

This optimisation is one of three added to the new Elastic.Transport project that was suitable to backport to 7.x.

Lazily caches the Uri on RequestData since this property is accessed at least three times and each time was allocating a new Uri. This saves 192 bytes per request.
@stevejgordon stevejgordon merged commit 6129a8c into 7.14 Jul 13, 2021
@stevejgordon stevejgordon deleted the perf/optimise-transport branch July 13, 2021 12:34
github-actions bot pushed a commit that referenced this pull request Jul 13, 2021
* Cache RequestData.Uri once created

Lazily caches the Uri on RequestData since this property is accessed at least three times and each time was allocating a new Uri. This saves 192 bytes per request.

* Ensure we reset the Uri if the Node changes
stevejgordon added a commit that referenced this pull request Jul 13, 2021
* Cache RequestData.Uri once created

Lazily caches the Uri on RequestData since this property is accessed at least three times and each time was allocating a new Uri. This saves 192 bytes per request.

* Ensure we reset the Uri if the Node changes

Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant