aslushnikov / tracium

A blessed Chrome Trace parser.
Apache License 2.0
72 stars 7 forks source link

How to replicate the Chrome devtools bottom-up tab with tracium #16

Open aholachek opened 4 years ago

aholachek commented 4 years ago

Hi, this is just a question, so please feel free to close if it's not appropriate.

I was hoping to use the array of tasks returned by tracium with flatten=true to replicate the Chrome devtools bottom-up view with group by url turned on.

My code basically:

  1. filters the tracium-returned tasks to those with a kind of scriptParseCompile and which have a event.args.data.url.
  2. feeds the lineNumber, columnNumber, and url from the event.args.data into the source-map library (along with the relevant sourcemap), receiving an original source location in return.
  3. aggregates the different sources based on the selfTime value returned by tracium.

While this yields something that looks reasonable, when I compare the results to the bottom-up tab in the devtools viewer, they are quite off, with many entries visible in the devtools but missing from my scripted version.

Can you see anything obviously off with my approach as I've described it?