Closed Bug 1674737 Opened 4 years ago Closed 4 years ago

Pass SpliceableJSONWriter to StreamJSONMarkerData, and attach UniqueJSONStrings

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
84 Branch
Tracking Status
firefox84 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

Currently StreamJSONMarkerData functions (in marker definition structs) are given a JSONWriter reference.

Some markers, like GC major/minor/slice, need to splice JSON strings (without escaping them). So instead of a JSONWriter, we now give SpliceableJSONWriter to StreamJSONMarkerData.

Some other markers, like Screenshot, also need to store some data as unique strings.
To help with that, the UniqueJSONStrings object that's used when streaming a profile, will be attached to the SpliceableJSONWriter, and relevant functions will be added.

Some markers (e.g., GC major/minor/slice) need to splice JSON strings in their data.
So now, instead of JSONWriter, StreamJSONMarkerData functions will be given a mozilla::baseprofiler::SpliceableJSONWriter.

Depends on D95116

Some markers (e.g., Screenshot) use unique strings in their data.

The UniqueJSONStrings used during streaming is attached to the SpliceableJSONWriter, and StreamJSONMarkerData can use pass-through functions UniqueStringProperty() and UniqueStringElement().

Depends on D95511

Unique strings are used to encode all markers' 'name' field, SpliceableJSONWriter::UniqueStringElement can be used for that (instead of a caller-provided callback, which was necessary before UniqueJSONStrings was de-duplicated).

Depends on D95512

Pushed by gsquelart@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c19cd174982c
Use SpliceableJSONWriter instead of JSONWriter when streaming markers - r=gregtatum
https://hg.mozilla.org/integration/autoland/rev/d203ffa2b29e
Make SpliceableJSONWriter optionally point at a UniqueJSONStrings, with pass-through functions - r=gregtatum
https://hg.mozilla.org/integration/autoland/rev/855f21902872
Use SpliceableJSONWriter::UniqueStringElement in DeserializeAfterKindAndStream - r=gregtatum
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: