Open Bug 1774328 Opened 2 years ago Updated 2 years ago

Gecko Profiler JSON marker schemas should also define a list of properties, and marker payloads should be stored as arrays

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

People

(Reporter: mozbugz, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Marker payloads are stored as JSON/JS objects, meaning in particular that property names are repeated in every instance of markers.

To reduce this duplication, markers should adopt the schema+array model:
Along with the existing marker schemas that define how marker data should be display, we could store the expected list of properties that each marker type should include.
Then, marker data/payload could now be stored as an array.
Optional properties could be left undefined (if at the end of the array), or null. (TBC, if it's really needed?)

Before:
[ ..., { "type": "text", "detail": "some text" } ]
(Note that "type": and "detail": are repeated in every instance of text markers!)

After bug 1774326, moving the type to the top-level, as an integer id:
[ ..., 1, { "detail": "some text" } ] (Assuming 1 is the id for "text" markers.)

After this bug:
[ ..., 1, [ "some text" ] ]
And once in the marker schemas area, something like: { 1: [ "detail" ], ... }.

This would require front-end changes, including a converter from previous versions.

You need to log in before you can comment on or make changes to this bug.