2 个稳定版本
1.6.1 | 2022年6月1日 |
---|
#168 in 性能分析
98 每月下载量
在 10 个 Crates 中使用(通过 cyfs-bdt)
255KB
6K SLoC
raptorq
RaptorQ (RFC6330) 的 Rust 实现
恢复属性:收到 K + h 个数据包后的重建概率 = 1 - 1/256^(h + 1)。其中 K 是原始消息中的数据包数量,h 是接收到的额外数据包数量。参见高通的“RaptorQ 技术概述”。
此 crate 需要 Rust 1.46 或更高版本。
示例
请参阅 examples/
目录以了解用法。
基准测试
以下基准测试是在 Intel Core i5-6600K @ 3.50GHz 上运行的
Symbol size: 1280 bytes (without pre-built plan)
symbol count = 10, encoded 127 MB in 0.532secs, throughput: 1924.7Mbit/s
symbol count = 100, encoded 127 MB in 0.590secs, throughput: 1734.6Mbit/s
symbol count = 250, encoded 127 MB in 0.572secs, throughput: 1788.4Mbit/s
symbol count = 500, encoded 127 MB in 0.549secs, throughput: 1858.8Mbit/s
symbol count = 1000, encoded 126 MB in 0.599secs, throughput: 1695.5Mbit/s
symbol count = 2000, encoded 126 MB in 0.673secs, throughput: 1509.1Mbit/s
symbol count = 5000, encoded 122 MB in 0.758secs, throughput: 1288.3Mbit/s
symbol count = 10000, encoded 122 MB in 0.953secs, throughput: 1024.7Mbit/s
symbol count = 20000, encoded 122 MB in 1.383secs, throughput: 706.1Mbit/s
symbol count = 50000, encoded 122 MB in 2.041secs, throughput: 478.5Mbit/s
Symbol size: 1280 bytes (with pre-built plan)
symbol count = 10, encoded 127 MB in 0.241secs, throughput: 4248.7Mbit/s
symbol count = 100, encoded 127 MB in 0.160secs, throughput: 6396.5Mbit/s
symbol count = 250, encoded 127 MB in 0.173secs, throughput: 5913.0Mbit/s
symbol count = 500, encoded 127 MB in 0.176secs, throughput: 5798.3Mbit/s
symbol count = 1000, encoded 126 MB in 0.200secs, throughput: 5078.1Mbit/s
symbol count = 2000, encoded 126 MB in 0.208secs, throughput: 4882.8Mbit/s
symbol count = 5000, encoded 122 MB in 0.280secs, throughput: 3487.7Mbit/s
symbol count = 10000, encoded 122 MB in 0.400secs, throughput: 2441.4Mbit/s
symbol count = 20000, encoded 122 MB in 0.494secs, throughput: 1976.8Mbit/s
symbol count = 50000, encoded 122 MB in 0.656secs, throughput: 1488.7Mbit/s
Symbol size: 1280 bytes
symbol count = 10, decoded 127 MB in 0.723secs using 0.0% overhead, throughput: 1416.2Mbit/s
symbol count = 100, decoded 127 MB in 0.701secs using 0.0% overhead, throughput: 1460.0Mbit/s
symbol count = 250, decoded 127 MB in 0.650secs using 0.0% overhead, throughput: 1573.8Mbit/s
symbol count = 500, decoded 127 MB in 0.638secs using 0.0% overhead, throughput: 1599.5Mbit/s
symbol count = 1000, decoded 126 MB in 0.676secs using 0.0% overhead, throughput: 1502.4Mbit/s
symbol count = 2000, decoded 126 MB in 0.764secs using 0.0% overhead, throughput: 1329.4Mbit/s
symbol count = 5000, decoded 122 MB in 0.896secs using 0.0% overhead, throughput: 1089.9Mbit/s
symbol count = 10000, decoded 122 MB in 1.176secs using 0.0% overhead, throughput: 830.4Mbit/s
symbol count = 20000, decoded 122 MB in 1.489secs using 0.0% overhead, throughput: 655.9Mbit/s
symbol count = 50000, decoded 122 MB in 2.633secs using 0.0% overhead, throughput: 370.9Mbit/s
symbol count = 10, decoded 127 MB in 0.713secs using 5.0% overhead, throughput: 1436.1Mbit/s
symbol count = 100, decoded 127 MB in 0.702secs using 5.0% overhead, throughput: 1457.9Mbit/s
symbol count = 250, decoded 127 MB in 0.637secs using 5.0% overhead, throughput: 1605.9Mbit/s
symbol count = 500, decoded 127 MB in 0.613secs using 5.0% overhead, throughput: 1664.8Mbit/s
symbol count = 1000, decoded 126 MB in 0.643secs using 5.0% overhead, throughput: 1579.5Mbit/s
symbol count = 2000, decoded 126 MB in 0.701secs using 5.0% overhead, throughput: 1448.8Mbit/s
symbol count = 5000, decoded 122 MB in 0.826secs using 5.0% overhead, throughput: 1182.3Mbit/s
symbol count = 10000, decoded 122 MB in 1.061secs using 5.0% overhead, throughput: 920.4Mbit/s
symbol count = 20000, decoded 122 MB in 1.380secs using 5.0% overhead, throughput: 707.7Mbit/s
symbol count = 50000, decoded 122 MB in 2.341secs using 5.0% overhead, throughput: 417.2Mbit/s
公共 API
请注意,由 benchmarking
功能标志导出的额外类不被视为此 crate 的公共 API。这些类的破坏性更改可能不会提前通知。此标志仅提供,以便可以在此 crate 的基准测试中使用内部类。
Python 绑定
Python 绑定使用 pyo3 生成。
某些操作系统可能需要安装额外的软件包。
$ sudo apt install python3-dev
maturin 建议用于构建此 crate 的 Python 绑定。
$ pip install maturin
$ maturin build --cargo-extra-args="--features python"
或者,请参阅 构建和分发部分 在 pyo3 用户指南 中。请注意,您必须向 Maturin 传递 --cargo-extra-args="--features python"
参数来构建此 crate 并启用 Python 绑定功能。
许可证
许可下
- Apache 许可证 2.0 版(LICENSE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
贡献
除非您明确声明,否则您有意提交供作品包含的贡献将按上述方式许可,不附加任何额外条款或条件。
依赖项
~0.5–1.4MB
~25K SLoC