rogchap / v8go

Execute JavaScript from Go

Home Page:https://rogchap.com/v8go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CPUProfiler HitCount

mnutt opened this issue · comments

I was reading through how to use the CPUProfiler, but didn't quite understand how to interpret the output from the sample printTree method. It seems like it produces a call tree but doesn't show the relative weights? v8 profiler has a hitCount attribute that I believe provides the number of samples from that CPUProfilerNode, would it make sense to pass that through so that we can tally up self / total hits in the output? I'd be happy to make a PR if that seems correct.

Yes, you're correct it would be great to have the other supported attributes exposed in the library. It was a TODO on the original PR that added the profiler: #167. Feel free to make a PR.