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

Fast mem #9

Merged
merged 7 commits into from
Nov 18, 2024
Merged

Fast mem #9

merged 7 commits into from
Nov 18, 2024

Conversation

anisse
Copy link
Owner

@anisse anisse commented Nov 17, 2024

No description provided.

… the same Trait

Instead of propagating the generic up with State, we use a trait object
and dynamic dispatch instead.

Criterion says:
     Running benches/mem.rs (target/release/deps/mem-35ff881bbdbd033b)
mem set                 time:   [1.2520 ns 1.2538 ns 1.2560 ns]
                        change: [-25.265% -24.900% -24.265%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 19 outliers among 100 measurements (19.00%)
  19 (19.00%) high severe

mem set full            time:   [82.123 µs 82.305 µs 82.527 µs]
                        change: [-27.445% -27.236% -27.034%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 21 outliers among 100 measurements (21.00%)

Getting rid of dynamic dispatch would probably be even faster, but at
the cost of having State become State<T: MemoryMapper> everywhere.

Game-gear only test with gears-cli shows a 5% global performance impact
though :-/
The Cpu is now a trait, and is used dynamically instead. This version
brings back the performance lost in the previous commit, and then
improves 4% on top, just through by using monomorphization, just through
by using monomorphization.
This will prevent forgetting about benchmarks
@anisse anisse merged commit b77459a into main Nov 18, 2024
7 checks passed
@anisse anisse deleted the fast-mem branch November 18, 2024 07:36
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