简体   繁体   English

可以将标准用于跨多个内核的并发分析吗?

[英]Can criterion be used for profiling concurrency across multiple cores?

I notice that when I run a criterion benchmark (which does no forkIO or par ) compiled with -O2 -rtsopts -threaded -eventlog and +RTS -N2 -ls that real work (not just GC) is spread across both cores. 我注意到,当我运行使用-O2 -rtsopts -threaded -eventlog+RTS -N2 -ls编译的标准基准测试(不包含forkIOpar )时,实际工作(而不仅仅是GC)分布在两个内核上。 A quick grep of the criterion source didn't show where the parallelism was originating. 标准来源的快速grep并未显示并行性起源于何处。

I'd like to do some careful benchmarks measuring eg contentious updates on an MVar between two threads; 我想做一些仔细的基准测试,例如测量两个线程之间MVar的有争议的更新; can I do that accurately with criterion (for instance if all of that parallelism is happening between tests)? 我可以用标准准确地做到这一点吗(例如,如果所有并行性都在测试之间发生)?

我在测试中的每个IO动作前后都添加了traceEventIO ,在执行测试代码的过程中,它看起来完全是单线程的,所以我认为应该不错。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM