ChaosBot avatar

【Rust日报】2019-08-26

blackanger

Published: 26 Aug 2019 › Updated: 26 Aug 2019【Rust日报】2019-08-26

【Rust日报】2019-08-26

北京Rust线下读书会,第一次举办

以下是现场图片,大家感受一下气氛,最后一张图片是东哥用脑图梳理的知识点
mhpC7R.jpg
mhpiA1.jpg
mhpkh6.jpg
mhp9B9.jpg

criterion.rs - 统计驱动基准测试库

Criterion.rs是一个能够快速准确的检测和测量性能的改进或回归(甚至是小型)来帮助您编写快速代码。 从而可以放心的进行优化,了解每个更改如何影响代码的性能

#[macro_use]
extern crate criterion;

use criterion::Criterion;
use criterion::black_box;

fn fibonacci(n: u64) -> u64 {
    match n {
        0 => 1,
        1 => 1,
        n => fibonacci(n-1) + fibonacci(n-2),
    }
}

fn criterion_benchmark(c: &mut Criterion) {
    c.bench_function("fib 20", |b| b.iter(|| fibonacci(black_box(20))));
}

criterion_group!(benches, criterion_benchmark);
criterion_main!(benches);

输出

Running target/release/deps/example-423eedc43b2b3a93
fib 20                  time:   [26.029 us 26.251 us 26.505 us]
Found 11 outliers among 99 measurements (11.11%)
  6 (6.06%) high mild
  5 (5.05%) high severe

仓库地址:https://github.com/bheisler/criterion.rs

pastel - 用于生成,分析,转换和操作颜色的命令行工具

pastel是一种用于生成,分析,转换和操作颜色的命令行工具。 它支持许多不同的颜色格式和颜色空间,如RGB,HSL,CIELAB,CIELCh以及ANSI 8位和24位表示。
in action

仓库地址:https://github.com/sharkdp/pastel

wasm-pack - wasm工作流程工具

该工具旨在成为构建和使用Rust的WebAssembly的一站式商店, wasm-pack可以帮助您构建Rust的WebAssembly包,您可以将它们发布到npm仓库或者与您已经使用的工作流中的任何javascript包一起使用,例如webpack或greenkeeper。

wasm-pack

仓库地址:https://github.com/rustwasm/wasm-pack

ripgrep - 高性能的在目录中正则表达式搜索工具

ripgrep是一种搜索工具,可以递归搜索当前目录中的正则表达式模式。 默认情况下,ripgrep将尊重您的.gitignore并自动跳过隐藏的文件/目录。 ripgrep在Windows,macOS和Linux上拥有一流的支持,每个版本都有二进制下载。 ripgrep类似于其他流行的搜索工具,如The Silver Searcher,ack和grep。
以下是在Intel i7-6900K 3.2 GHz的系统上的性能测试数据

ToolCommandLine countTime
ripgrep (Unicode)rg -n -w '[A-Z]+_SUSPEND'4500.106s
git grepLC_ALL=C git grep -E -n -w '[A-Z]+_SUSPEND'4500.553s
The Silver Searcherag -w '[A-Z]+_SUSPEND'4500.589s
git grep (Unicode)LC_ALL=en_US.UTF-8 git grep -E -n -w '[A-Z]+_SUSPEND'4502.266s
siftsift --git -n -w '[A-Z]+_SUSPEND'4503.505s
ackack -w '[A-Z]+_SUSPEND'18786.823s
The Platinum Searcherpt -w -e '[A-Z]+_SUSPEND'45014.208s

更多详情请参照仓库地址详情

仓库地址:https://github.com/BurntSushi/ripgrep


From 日报小组 月泉

日报订阅地址:

独立日报订阅地址:

社区学习交流平台订阅:

Leave 【Rust日报】2019-08-26 to:

Written by

Read more #rust posts


Best Posts From ChaosBot

We have not curated any of blackanger's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From ChaosBot