-
Notifications
You must be signed in to change notification settings - Fork 4
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
array_chunks
(performance feature), alloc
improvements, code modularisation.
#3
Conversation
array_chunks
(performance feature), alloc improvements.array_chunks
(performance feature), alloc improvements, splits code.
array_chunks
(performance feature), alloc improvements, splits code.array_chunks
(performance feature), alloc improvements, code modularisation.
array_chunks
(performance feature), alloc improvements, code modularisation.array_chunks
(performance feature), alloc
improvements, code modularisation.
Note: benchmarks are currently untested. Running tests now. |
... ok, so checking out 07:38:52 $ cargo criterion
07:39:16
Compiling base45 v3.0.0 (/home/zeen3/documents/projects/base45)
Finished bench [optimized] target(s) in 16.86s
running 15 tests
test tests::decode_ab ... ignored
test tests::decode_base45 ... ignored
test tests::decode_fail ... ignored
test tests::decode_fail_out_of_range ... ignored
test tests::decode_hello ... ignored
test tests::decode_ietf ... ignored
test tests::decode_long_string ... ignored
test tests::encode_ab ... ignored
test tests::encode_base45 ... ignored
test tests::encode_emoji ... ignored
test tests::encode_hello ... ignored
test tests::encode_hello_from_buffer ... ignored
test tests::encode_ietf ... ignored
test tests::encode_long_string ... ignored
test tests::encode_unicode ... ignored
test result: ok. 0 passed; 0 failed; 15 ignored; 0 measured; 0 filtered out; finished in 0.00s
encode long string time: [6.2442 us 6.2594 us 6.2764 us]
change: [+693.71% +696.46% +699.17%] (p = 0.00 < 0.05)
Performance has regressed.
encode long string from buffer
time: [6.3520 us 6.3731 us 6.3981 us]
change: [+694.97% +697.78% +700.66%] (p = 0.00 < 0.05)
Performance has regressed.
decode long string time: [1.7816 us 1.7912 us 1.8025 us]
change: [+52.709% +54.116% +55.609%] (p = 0.00 < 0.05)
Performance has regressed.
07:40:30 $ git checkout array_chunks
07:41:16
Switched to branch 'array_chunks'
07:41:16 $ cargo criterion
07:41:21
Compiling base45 v3.1.0 (/home/zeen3/documents/projects/base45)
warning: use of deprecated function `encode::encode_from_buffer`: Equivalent to `encode`. Use `encode` instead.
--> src/tests.rs:116:23
|
116 | let encoded = encode_from_buffer(&b[..]);
| ^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: use of deprecated function `encode::encode_from_buffer`: Equivalent to `encode`. Use `encode` instead.
--> src/tests.rs:94:9
|
94 | encode_from_buffer(vec![72, 101, 108, 108, 111, 33, 33]),
| ^^^^^^^^^^^^^^^^^^
warning: use of deprecated function `base45::encode_from_buffer`: Equivalent to `encode`. Use `encode` instead.
--> benches/bench.rs:12:13
|
12 | base45::encode_from_buffer(black_box(vec![
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
warning: 2 warnings emitted
warning: 1 warning emitted
Finished bench [optimized] target(s) in 12.21s
running 21 tests
test tests::decode_ab ... ignored
test tests::decode_base45 ... ignored
test tests::decode_fail ... ignored
test tests::decode_fail_out_of_range ... ignored
test tests::decode_hello ... ignored
test tests::decode_ietf ... ignored
test tests::decode_long_string ... ignored
test tests::encode_ab ... ignored
test tests::encode_base45 ... ignored
test tests::encode_emoji ... ignored
test tests::encode_hello ... ignored
test tests::encode_hello_from_buffer ... ignored
test tests::encode_ietf ... ignored
test tests::encode_long_string ... ignored
test tests::encode_unicode ... ignored
test tests::bench_decode_quick_brown_fox ... bench: 113,692 ns/iter (+/- 1,843)
test tests::bench_encode_quick_brown_fox ... bench: 77,526 ns/iter (+/- 248)
test tests::bench_encode_random_0x10 ... bench: 276 ns/iter (+/- 8)
test tests::bench_encode_random_0x100 ... bench: 2,693 ns/iter (+/- 37)
test tests::bench_encode_random_0x1000 ... bench: 39,509 ns/iter (+/- 187)
test tests::bench_encode_random_0x10000 ... bench: 646,121 ns/iter (+/- 4,902)
test result: ok. 0 passed; 0 failed; 15 ignored; 6 measured; 0 filtered out; finished in 8.02s
encode long string time: [736.05 ns 737.40 ns 738.88 ns]
change: [-88.277% -88.234% -88.189%] (p = 0.00 < 0.05)
Performance has improved.
encode long string from buffer
time: [764.57 ns 766.43 ns 768.50 ns]
change: [-88.037% -87.983% -87.927%] (p = 0.00 < 0.05)
Performance has improved.
decode long string time: [1.1312 us 1.1349 us 1.1391 us]
change: [-38.033% -37.372% -36.763%] (p = 0.00 < 0.05)
Performance has improved.
07:42:41 $ Of course, there are some optimizations I could be running which I'm currently not but... as of yet I'm working on them. Only 1--2% increase, I guess. |
…. Looks weird but meh.
Old:
New:
with
Unsure as to how this handles. Relatively, there's not too much that needs work, I think... With other potential performance boosts available (variable length arrays on stack), we could see more minor improvements in the long term, though. |
vs branch
I think 90% encode and >50% decode perf is ok... |
Sorry that I haven't looked at this, I've been away on parental leave! 😅 I just merged #2 and I don't know how that affects your PR |
All good, shit happens. Basically just dumped everything since I had basically rewritten the entire thing... |
Version updating is handled by semantic release in actions workflow
Also handled by semantic release
Finally remembered this, thank you so much for the contribution! 🎉 |
array_chunks
/chunks_exact
for branchless performance improvements, and potentially reduced code size for constrained devices.String
andVec
to reduce allocations during runtime.decode
,encode
, andtest
modules.