【Rust日报】2022-02-24 字符串连接操作的基准测试

香小蕉

关注

阅读 68

2022-06-28

字符串连接操作的基准测试

基于 Hendrik Sollich 在 4 年前的工作,作者添加了一些常用的函数和宏的基准结果:

0 ns/iter (+/- 0) from_bytes
10 ns/iter (+/- 0) concat_string_macro
10 ns/iter (+/- 0) concat_strs_macro
10 ns/iter (+/- 0) mut_string_with_capacity_push_str_char
10 ns/iter (+/- 0) string_concat_macro
10 ns/iter (+/- 1) mut_string_with_capacity_push_str
14 ns/iter (+/- 0) concat_in_place_macro
19 ns/iter (+/- 10) mut_string_with_too_much_capacity_push_str
22 ns/iter (+/- 0) array_join
24 ns/iter (+/- 0) array_concat
24 ns/iter (+/- 0) array_join_long
24 ns/iter (+/- 0) mut_string_push_str
27 ns/iter (+/- 0) string_from_plus_op
27 ns/iter (+/- 0) to_string_plus_op
29 ns/iter (+/- 0) to_owned_plus_op
30 ns/iter (+/- 0) collect_from_array_to_string
34 ns/iter (+/- 0) collect_from_vec_to_string
39 ns/iter (+/- 0) mut_string_with_too_little_capacity_push_str
43 ns/iter (+/- 1) string_from_all
52 ns/iter (+/- 0) format_macro
53 ns/iter (+/- 0) format_macro_implicit_args
68 ns/iter (+/- 1) mut_string_push_string

GitHub - hoodie/concatenation_benchmarks-rs: https://github.com/hoodie/concatenation_benchmarks-rs

String concatenations benchmarks (updated): https://www.reddit.com/r/rust/comments/t06hk7/string_concatenations_benchmarks_updated/

热议 - 2022 年你会选择哪种 Web 框架

Sylvain Kerkour ,Bloom 的创建者也是 Black Hat Rust 一书的作者,发文对比了 actix-web、warp 和 axum 三个 Web 框架,结合代码示例进行了一个简单的评估。尽管作者心属 axum,但还是选择 actix-web 作为 Bloom 的首选。

Reddit 上的网友则提供了更多讨论,包括 tide ,rocket 以及 poem 。

Which Rust web framework to choose in 2022 (with code examples): https://www.reddit.com/r/rust/comments/szl0im/which_rust_web_framework_to_choose_in_2022_with/

This Week in Rust 431

新一期的 Rust 周报速递发布,快来看看有哪些内容你曾经关注过 :)

This Week in Rust 431: https://this-week-in-rust.org/blog/2022/02/23/this-week-in-rust-431/


社区学习交流平台订阅:

  • Rust.cc 论坛: 支持 rss
  • 微信公众号:Rust 语言中文社区


精彩评论(0)

0 0 举报