jonhoo / inferno

A Rust port of FlameGraph

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support output to files directly instead of just via output redirection

saethlin opened this issue · comments

In my profiles I'm seeing 3.3% of cycles spent in std::memchr::memchr, because the standard library's stdout wrapper is trying to detect newlines and flush on them. Which is silly.

Ah, yes, that's a good idea. I think in theory it should be pretty easy to have the structure hold a dyn Write that defaults to stdout maybe. We could make it generic over Write, though that'd be backwards incompatible, and the performance difference is unlikely to make too much of a difference. Will also probably save us from having to frequently unlock and re-lock stdout!