-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add benchmark for base64 #8768
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
Add benchmark for base64 #8768
Conversation
c5d10da to
7e57b2f
Compare
| // Benchmark different file sizes for base64 decoding | ||
| #[divan::bench(args = [10, 50, 100, 1_000, 5_000])] | ||
| fn b64_decode_synthetic(bencher: Bencher, size_mb: usize) { | ||
| let temp_dir = tempfile::tempdir().unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look like it is duplicated code with the two other tests ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this, I see wc_bench is also the same... but I can make a function that at least takes away the first part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could also improve wc_bench then :)
| let data = text_data::generate_by_size(size_mb, 80); | ||
| let file_path = create_test_file(&data, temp_dir.path()); | ||
| let file_path_str = file_path.to_str().unwrap(); | ||
| let encoded_data = Command::new("base64") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not a fan of the Command call
can we call the function directly instead ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try, it needs also the configuration and I preferred using something more general...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to capture the output of this base64 encoding? This way it would save also some more code (and space on disk)
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #8768 will not alter performanceComparing Summary
Benchmarks breakdown
Footnotes
|
51d225f to
1c20c54
Compare
|
GNU testsuite comparison: |
1c20c54 to
a725038
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
2344b61 to
3f6eff7
Compare
|
GNU testsuite comparison: |
3f6eff7 to
a725038
Compare
|
the [[bench]] section is mandatory |
81246f8 to
bb4513b
Compare
Yes, it was my mistake removing it, I added it back |
|
GNU testsuite comparison: |
bb4513b to
8bf2919
Compare
|
GNU testsuite comparison: |
For performance monitoring, added benchmark for base64. Those benchmarks include testing encoding, decoding and decoding ignoring garbage characters. Signed-off-by: Andrea Calabrese <[email protected]>
8bf2919 to
60b9b87
Compare
|
GNU testsuite comparison: |
|
actually, it failed: Running uu_base64 base64_bench |
For performance monitoring, added benchmark for base64. Those benchmarks include testing encoding, decoding and decoding ignoring garbage characters.
These benchmarks were developed following the benchmarks in wc as examples.