-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New CPU Profile Format #21
Comments
I have some converters from the "old" v8-profiler format, to the new inspector "1.2" format, here: https://github.com/moar-things/moar-profile-viewer/tree/master/lib/profile |
Well we'd need the opposite of that. However I believe it's better to make the processor handle the new format. |
Any progress on this by chance? Really love using this tool :) |
No, I'm debating to retire this tool and tell people to use 0x instead. |
When saving a cpu profile from DevTools the emitted format is different from what this app expects (it changed).
At this point I have no bandwidth fixing this, but am documenting the changes as far as I understand them by now.
Changes
Properties
The properties of a profile changed.
Nodes/Callgraph
head
used to be the entry point to all nodes by following the nested children (which also mirrored the callgraph).Now we have a
nodes
Array each of which has a flat Array of children ids. The actual child node needs to be resolved from the same nodes array.The call graph needs to be reconstructed from that information as well as it now isn't mirrored like it was before.
Samples/Time Deltas
Samples didn't change, however we have an additional Array,
timeDeltas
. This tells us the time in between each sampling tick. Turns out that time is not perfectly constant (can very by about 30%) and thus this information can be used to correct the amount of time spent in a function.Especially when aggregating this data to create a flamegraph this correction could prove important.
Changes Needed
The processor needs to be able to handle this new format. To just get it to work it mainly needs to be able to lookup the children by id and somehow reconstruct the callgraph.
Since these scripts were adapted from perl scripts and steps are not perfectly isolated, this change may affect multiple parts of the processor.
Compatibility
In order to still work for the old format, the processor would need to be able to handle both, or we need a function that transforms old profiles to the new format (IMO the better solution).
The text was updated successfully, but these errors were encountered: