Skip to content

Conversation

@alexander-yakushev
Copy link
Contributor

Further improvements to method dispatching machinery. When it is cached, this shouldn't matter, but I keep encountering cases where it is not cached and thus it matters a bit.

For the benchmark, I've accumulated a sample of ~20k argument sets to effective-dispatch-value I got these results:

Before:
Time per call: 13.83 ms   Alloc per call: 31,446,785b
Time per call: 13.82 ms   Alloc per call: 31,446,785b

After:
Time per call: 7.44 ms   Alloc per call: 8,638,718b
Time per call: 7.40 ms   Alloc per call: 8,638,718b

Normalized to a single invocation, this means that a single invocation allocations dropped from 1.39KB to 380B which looks significant enough for something as basic as a multimethod invocation.

@camsaul camsaul merged commit 680aa8f into camsaul:master May 12, 2025
6 checks passed
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.

2 participants