davidmarkclements / 0x

🔥 single-command flamegraph profiling 🔥
MIT License
3.23k stars 106 forks source link

cpu-profile-to-tree: Refactor out the filtering of parenthesized nodes #258

Closed kazarmy closed 2 years ago

kazarmy commented 2 years ago

This pr refactors out the code that does the filtering of parenthesized nodes like (idle) and (garbage collector) in cpu-profile-to-tree.js, as well as doing some related cleanup and testing.

As a side note, it appears that (program) refers to V8 infrastructure code and that (idle), (garbage collector) and (program) are guaranteed not to have any children but this does assume that I'm reading the code correctly and that conclusions made on Node's V8 code is generalizable to other V8 implementations.