generated from Nugine/rust-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
test: add zuc128_benchmark #7
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nugine
requested changes
Dec 16, 2024
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.
- 可以仅用 Example3 的 key 和 iv 初始化,不需要重复这些 example 数据
- 使用 criterion 的吞吐测量功能
- 使用 bench_with_input,分别测量 1000,2000,3000,10000,20000,30000 次 generate 的耗时
最终需要能看到 zuc128 generate 的吞吐性能 (bytes per second)。
注意:每次 generate 生成 u32 (4 bytes)。
用 black_box 避免某些调用被优化删除
https://docs.rs/criterion/latest/criterion/fn.black_box.html
Running benches\zuc128_benchmark output Gnuplot not found, using plotters backend
zuc128_generate_throughput/1000
time: [7.0246 µs 7.0607 µs 7.1039 µs]
thrpt: [536.99 MiB/s 540.27 MiB/s 543.05 MiB/s]
change:
time: [-3.4192% -2.7769% -2.0803%] (p = 0.00 < 0.05)
thrpt: [+2.1245% +2.8562% +3.5403%]
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
2 (2.00%) high mild
1 (1.00%) high severe
zuc128_generate_throughput/2000
time: [13.960 µs 14.010 µs 14.063 µs]
thrpt: [542.51 MiB/s 544.57 MiB/s 546.51 MiB/s]
change:
time: [-3.5995% -3.0574% -2.4854%] (p = 0.00 < 0.05)
thrpt: [+2.5488% +3.1538% +3.7339%]
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe
zuc128_generate_throughput/3000
time: [21.396 µs 21.556 µs 21.724 µs]
thrpt: [526.79 MiB/s 530.89 MiB/s 534.88 MiB/s]
change:
time: [-3.3541% -2.5523% -1.7863%] (p = 0.00 < 0.05)
thrpt: [+1.8188% +2.6192% +3.4705%]
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
3 (3.00%) high mild
1 (1.00%) high severe
zuc128_generate_throughput/10000
time: [72.835 µs 73.622 µs 74.495 µs]
thrpt: [512.07 MiB/s 518.14 MiB/s 523.75 MiB/s]
change:
time: [+0.6526% +2.5603% +5.2247%] (p = 0.02 < 0.05)
thrpt: [-4.9653% -2.4964% -0.6484%]
Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
4 (4.00%) high mild
2 (2.00%) high severe
zuc128_generate_throughput/20000
time: [147.13 µs 147.76 µs 148.44 µs]
thrpt: [513.98 MiB/s 516.34 MiB/s 518.54 MiB/s]
change:
time: [-2.3143% -1.5925% -0.9274%] (p = 0.00 < 0.05)
thrpt: [+0.9361% +1.6183% +2.3691%]
Change within noise threshold.
Found 6 outliers among 100 measurements (6.00%)
3 (3.00%) high mild
3 (3.00%) high severe
zuc128_generate_throughput/30000
time: [219.27 µs 220.23 µs 221.24 µs]
thrpt: [517.27 MiB/s 519.64 MiB/s 521.91 MiB/s]
change:
time: [-1.9726% -1.5208% -1.0746%] (p = 0.00 < 0.05)
thrpt: [+1.0863% +1.5442% +2.0122%]
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) high mild
2 (2.00%) high severe |
Nugine
reviewed
Dec 16, 2024
Nugine
reviewed
Dec 16, 2024
看下 CI 报错,修完即可合并 |
Nugine
approved these changes
Dec 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.