Also, please try Perl 6. The marketing may be a cautionary example, but the language itself reflects 15 years of polish.
While I respect that Perl development is still going, I haven’t seen it used by anyone in production for at least 15 years.
It would also likely be better (more readable and maintainable) and faster written in something else (did a partial Python port to understand what kind of munging the script actually did, the Python version was 50% faster, and a bit shorter though the latter may have been because I didn't test/check all features and some of the edge cases may have been missing in the non-default options).
Yep it is JavaScript: https://github.com/google/pprof/blob/master/third_party/d3fl...