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

Modify benchmark to load sources only once #4174

Merged
merged 2 commits into from
Oct 23, 2024
Merged

Modify benchmark to load sources only once #4174

merged 2 commits into from
Oct 23, 2024

Conversation

Cyan4973
Copy link
Contributor

@Cyan4973 Cyan4973 commented Oct 22, 2024

Long time ago, after a regrettable update, the benchmark module ended up reloading sources for every output line, i.e. every compression level.

While the loading delay itself is likely tolerable,
the main issue is that the --quiet mode now also displays a loading summary between each compression line.
This wasn't the original intention, which is to produce a compact view of all compression results.

This is fixed in this version,
where sources are loaded only once, for all compression levels, and loading summary is now only displayed once, as intended.

Before (dev) :

zstd -b1e5 calgary.tar enwik7 -q -S
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks
-1      1138663 (2.770)  43.59 MB/s  190.2 MB/s  calgary.tar
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks
-2      1063638 (2.965)  42.62 MB/s  137.6 MB/s  calgary.tar
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks
-3      1020606 (3.090)  33.07 MB/s  125.3 MB/s  calgary.tar
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks
-4      1011132 (3.119)  32.72 MB/s  121.2 MB/s  calgary.tar
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks
-5       984050 (3.205)  16.20 MB/s  119.4 MB/s  calgary.tar
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks
-1      4105389 (2.436)  37.88 MB/s  168.3 MB/s  enwik7
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks
-2      3758552 (2.661)  38.16 MB/s  117.6 MB/s  enwik7
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks
-3      3565658 (2.805)  30.16 MB/s  105.9 MB/s  enwik7
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks
-4      3493017 (2.863)  30.88 MB/s  102.3 MB/s  enwik7
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks
-5      3392330 (2.948)  15.05 MB/s   99.5 MB/s  enwik7

fixed in this PR :

zstd -b1e5 calgary.tar enwik7 -q -S
bench 1.5.6 : input 3153920 bytes, 0 seconds, 0 KB blocks          
-1      1138663 (2.770) 316.74 MB/s 1114.0 MB/s  calgary.tar                                                                          
-2      1063638 (2.965) 222.79 MB/s  951.7 MB/s  calgary.tar                                                                          
-3      1020606 (3.090) 165.58 MB/s  909.1 MB/s  calgary.tar       
-4      1011132 (3.119) 156.22 MB/s  894.6 MB/s  calgary.tar       
-5       984050 (3.205)  92.40 MB/s  868.1 MB/s  calgary.tar
bench 1.5.6 : input 10000000 bytes, 0 seconds, 0 KB blocks      
-1      4105389 (2.436) 276.81 MB/s 1015.4 MB/s  enwik7
-2      3758552 (2.661) 194.60 MB/s  864.6 MB/s  enwik7
-3      3565658 (2.805) 149.71 MB/s  803.3 MB/s  enwik7
-4      3493017 (2.863) 145.57 MB/s  807.5 MB/s  enwik7
-5      3392330 (2.948)  87.99 MB/s  788.0 MB/s  enwik7

After a regrettable update,
the benchmark module ended up reloading sources for every compression level.

While the delay itself is likely torelable,
the main issue is that the `--quiet` mode now also displays a loading summary between each compression line.
This wasn't the original intention, which is to produce a compact view of all compressions.

This is fixed in this version,
where sources are loaded only once, for all compression levels,
and loading summary is only displayed once.
@Cyan4973 Cyan4973 self-assigned this Oct 22, 2024
@Cyan4973 Cyan4973 marked this pull request as ready for review October 22, 2024 10:56
@Cyan4973 Cyan4973 force-pushed the bench_loadOnce branch 2 times, most recently from f758b6e to 884adc0 Compare October 23, 2024 07:03
update the man page in troff format,
and the README with latest `--help` content and complementary details about benchmark mode.

also: display level 0 when doing decompression benchmark
@Cyan4973 Cyan4973 merged commit dfaf5fa into dev Oct 23, 2024
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants