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

Use SmallVec for VM #19

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft

Use SmallVec for VM #19

wants to merge 3 commits into from

Conversation

tomoyanonymous
Copy link
Owner

#11

This PR replaces Vec<T> in the VM and Program codes to SmallVec<[T;4]>.

Sadly, It rather slowers benchmark even in release profile.

No SmallVec

Running benches/bench.rs (/Users/tomoya/codes/mimium-rs/target/release/deps/bench-d4460aba5585daad)

running 4 tests
test tests::bench_multiosc5  ... bench:       1,253 ns/iter (+/- 57)
test tests::bench_multiosc7  ... bench:       1,744 ns/iter (+/- 144)
test tests::bench_multiosc10 ... bench:       2,483 ns/iter (+/- 122)
test tests::bench_multiosc15 ... bench:       3,694 ns/iter (+/- 76)

SmallVec[4] only for vm.rs

Running benches/bench.rs (/Users/tomoya/codes/mimium-rs/target/release/deps/bench-e707ff430debe52f)

running 4 tests
test tests::bench_multiosc5  ... bench:       1,366 ns/iter (+/- 398)
test tests::bench_multiosc7  ... bench:       1,876 ns/iter (+/- 44)
test tests::bench_multiosc10 ... bench:       2,664 ns/iter (+/- 86)
test tests::bench_multiosc15 ... bench:       3,983 ns/iter (+/- 117)

SmallVec[4] vm and program

Running benches/bench.rs (/Users/tomoya/codes/mimium-rs/target/release/deps/bench-e707ff430debe52f)

running 4 tests
test tests::bench_multiosc5  ... bench:       1,545 ns/iter (+/- 111)
test tests::bench_multiosc7  ... bench:       2,140 ns/iter (+/- 147)
test tests::bench_multiosc10 ... bench:       3,036 ns/iter (+/- 85)
test tests::bench_multiosc15 ... bench:       4,541 ns/iter (+/- 106)

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