davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.21k stars 103 forks source link

fix: collect-only to render-only flow #253

Closed adiktofsugar closed 2 years ago

adiktofsugar commented 2 years ago

In v8-log-to-ticks.js:152

const delayMs = options.collectDelay * 1000
...
// Compare ticks to first for collectDelay
if (tick.tm > (firstTick[0] + delayMs)) {
  ticks.push(stack.reverse())
}

But without this change, collectDelay is NaN so firstTick[0] + NaN ends up NaN, which always returns false when compared to a number, so this never resolves to true, and no ticks get added.