Support profiler markers in the shell
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
People
(Reporter: iain, Assigned: iain)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
To allow samply and other profilers to identify which parts of a benchmark run count as measured time, the browser supports dumping information to an external file for each call to performance.mark/measure.
To help with tooling for JetStream 3, we should add similar functionality to the shell.
| Assignee | ||
Comment 1•1 year ago
|
||
This patch supports a limited version of performance.mark/measure to emit entries in an external marker file for use in profiling.
Note that the semantics of mark/measure are different here than in the browser. In the browser:
markandmeasureboth return objects.- The
startMarkandendMarkarguments tomeasureare expected to be strings. markadds a durationless marker to the performance timeline, and measure adds a range to the timeline.
In this implementation:
markreturns an object, butmeasuredoesn't return anything.measureonly supports the (name, startMark) version, andstartMarkmust be the object returned by an earlier call tomark.markhas no side-effects.measureadds a line to the external marker file with the start and end timestamps, and the label.
This currently dumps whatever PRMJ_Now returns (which I think is unix timestamps).
To work with JetStream, the runner must be modified to treat SM the same way it already treats V8:
https://github.com/iainireland/JetStream/commit/d9e1781ed834d778f605400fd03346aeae13b4cd
Description
•