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

LocalSet optimisations #356

Closed
wants to merge 1 commit into from
Closed

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented Sep 27, 2023

Optimise some parts of the code by making use of the fact that a LocalSet can execute !Send futures.

This is mostly an experiment, seeing whether the additional allocations to simply being able to send the values to the different executor thread are even worth it.

@aumetra
Copy link
Member Author

aumetra commented Sep 27, 2023

An example for the target of the optimisations is the parsing of the mentions. The parsing itself is very quick, microseconds even, but we need a Mutex to synchronize accesses to the accumulator.

That synchronization overhead could be avoided using a LocalSet even though the atomics overhead should be negligible.

Another thing this would allow us is also to introduce bump allocation to certain paths in the code, since allocation arenas are inherently !Send.

Again, whether the overhead of the triple boxing+channel send is worth it in the end has to be checked.

@aumetra aumetra closed this Oct 4, 2023
@aumetra aumetra deleted the aumetra/localset-optimizations branch October 4, 2023 15:26
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.

1 participant