1

我正在尝试使用带有我使用Rayon编写的代码的火焰箱获得一些性能指标:

extern crate flame;

flame::start("TAG-A");
//Assume vec is a Vec<i32>
vec.par_iter_mut().filter(|a| a == 1).for_each(|b| func(b));
//func(b) operates on each i32 and sends some results to a channel
flame::end("TAG-A");
//More code but unrelated
flame::dump_stdout();

这工作正常,但只提供整个并行迭代器的信息。我想获得有关该功能的一些更细粒度的细节func

我尝试在函数中添加开始/结束,但运行时信息仅在我调用时可用flame::commit_thread(),然后它似乎只将其打印到标准输出。理想情况下,当我在代码末尾调用 dump 时,我想打印出没有给定标签所花费的时间。

有没有办法从所有线程中转储标签?火焰的文档不是很好。

4

0 回答 0