前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【Rust日报】2022-02-24 字符串连接操作的基准测试

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

作者头像
MikeLoveRust
发布2022-03-24 13:25:01
2820
发布2022-03-24 13:25:01
举报
文章被收录于专栏:Rust语言学习交流

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

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

代码语言:javascript
复制
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/


From 日报小组 PsiACE

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-02-24,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 Rust语言学习交流 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 字符串连接操作的基准测试
  • 热议 - 2022 年你会选择哪种 Web 框架
  • This Week in Rust 431
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档