< 返回版块

binarytom 发表于 2022-04-30 22:48

通过 BSON 和零拷贝反序列化在 MongoDB Rust 驱动程序中解锁更高的性能

Rust BSON 库(bson crate)的 2.2.0 版本引入了一个“原始”BSON API,它使我们能够在 Rust MongoDB 驱动程序(mongodb crate)中实现一些内部性能改进,并且在某些情况下,可以用户利用它来显着提高查询性能,包括通过使用 serde 的零拷贝反序列化功能。 在这篇文章中,我将演示如何使用这个新的 API,并提供一些例子来说明它可以帮助你加快阅读速度。

文章链接,https://patrickfreed.github.io/rust/2022/04/27/unlocking-greater-performance-in-the-mongodb-rust-driver-via-raw-bson-and-zero-copy-deserialization.html

pandet (v0.1.1)

一个轻量级库,可帮助您检测生成的异步任务的失败情况,而无需 .await 其句柄。当您产生大量的任务但希望在发生问题时快速失败的时候很有用。

use pandet::{PanicAlert, OnPanic};

let alert = PanicAlert::new();
let detector = alert.new_detector();

// Whichever async task spawner
task::spawn(
    async move {
        panic!();
    }
    .on_panic(&detector) // 👈
);

assert!(alert.await.is_err());

Github 链接,https://github.com/kkaatii/pandet/

文章链接,https://crates.io/crates/pandet

accord (v0.1.0)

Accord 是一个基于 TCP 的即时消息聊天系统,使用 Rust 编写。

目标是保持极简主义,但不以牺牲可用性为代价。

Github 链接,https://github.com/loipesmas/accord

文章链接,https://www.reddit.com/r/rust/comments/ueuhtn/i_offer_you_accord_v010/


From 日报小组 TOM

社区学习交流平台订阅:

评论区

写评论

还没有评论

1 共 0 条评论, 1 页