-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
From the current examples:
const profiler = new Profiler({ sampleInterval: 10, maxBufferSize: 10000 });
const start = performance.now();
for (let i = 0; i < 1000000; i++) {
doWork();
}
const duration = performance.now() - start;
const trace = await profiler.stop();
const traceJson = JSON.stringify({
duration,
trace,
});
sendTrace(traceJson);While serializing the JSON might be okay for small profiles, it seems risky to encourage it as a general solution. Would it be better to provide the profile as serialized JSON already, potentially removing some blocking work from the main thread? It's not unlikely that those data structures wouldn't have to exist in the JS heap at any point in time.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels