Skip to content

refactor(server): less allocs per method call #1188

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 1 commit into from
Aug 18, 2023

Conversation

niklasad1
Copy link
Contributor

This PR removes a few needless clones for shared params which are now put in an Arc to be able to be shared
across tokio::spawn

Seems to improve things slightly as this occurs on every call.

@niklasad1 niklasad1 requested a review from a team as a code owner August 18, 2023 08:48
Copy link
Collaborator

@jsdw jsdw left a comment

Choose a reason for hiding this comment

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

Makes sense to me; I guess none of the htings in params were very big (mostly other Arc-y type things I think) but one arc clone is always going to win :)

@niklasad1
Copy link
Contributor Author

niklasad1 commented Aug 18, 2023

yeah it made things slightly better, as you noted I think it's like doing one Arc::clone instead of a few Arc::clones per request.

@niklasad1 niklasad1 merged commit 1af525c into master Aug 18, 2023
@niklasad1 niklasad1 deleted the na-server-less-alloc-per-call branch August 18, 2023 13:24
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