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

Pass ReducerContext earlier by reference #2298

Open
Centril opened this issue Feb 24, 2025 · 0 comments
Open

Pass ReducerContext earlier by reference #2298

Centril opened this issue Feb 24, 2025 · 0 comments
Labels
backward-compatible enhancement New feature or request performance A PR/Issue related to improving performance of stdb

Comments

@Centril
Copy link
Contributor

Centril commented Feb 24, 2025

We pass the ctx: ReducerContext by move in __call_reducer__ and in a few hops before we actually reach reducer.invoke(&ctx, args) where it's finally passed by reference. However, size_of_val(&ctx) is 400, mainly due to rng, so this will likely result in memcpy rather than passing in registers. Avoid this by immediately passing ctx by reference in __call_reducer__.

@Centril Centril added backward-compatible enhancement New feature or request performance A PR/Issue related to improving performance of stdb labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backward-compatible enhancement New feature or request performance A PR/Issue related to improving performance of stdb
Projects
None yet
Development

No branches or pull requests

1 participant