Closed Bug 1774329 Opened 3 years ago Closed 3 years ago

Remove unneeded white spaces in JSON output

Categories

(Core :: Gecko Profiler, task, P2)

task

Tracking

()

RESOLVED FIXED
105 Branch
Tracking Status
firefox105 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

(Blocks 1 open bug)

Details

Attachments

(14 files)

3.71 KB, patch
Details | Diff | Splinter Review
5.94 KB, patch
Details | Diff | Splinter Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

A possible quick win: Remove unneeded white spaces in JSON output. In particular, indents are currently adding a lot of characters!

Thank you Florian for finding out about this issue.

Attached patch WIP patchSplinter Review

From what I remember, this mostly worked, but I had a few line breaks left (I think I had one every time a child process profile was joined to the parent profile), which got in the way of writing an automated test.

This is my previous attempt, which was less finished, but I additionally tried to remove the aStyle parameters that became useless. I stopped and started over because I think removing useless parameters should be split out to a separate patch.

JSON whitespace comprises all spaces and newlines that are not inside strings,
and which could be removed without changing the decoded contents.

This tests the current state of affairs, where JSON whitespace in profiles may
account for up to 25% of the full length.

Assignee: nobody → gsquelart
Status: NEW → ASSIGNED

These were the last remaining JSON whitespace characters, so we can now our
regression tests can check that there are non of these left.

Depends on D152606

As a bonus, this adds coverage of getProfileDataAsArrayBuffer().

Depends on D152609

Centralize calls to getProfileDataAsync to stop{,Now}AndGetProfile() in shared-head.js.

Depends on D152609

This covers the gc stats' JSONPrinter changes, and would trigger the
verifyJSONStringIsCompact assertion (see next patch) without these changes.

Depends on D152843

Attachment #9286994 - Attachment description: Bug 1774329 - Add mochitest to verify there are no whitespaces in multi-process profile - r?florian → Bug 1774329 - Verify that there are no whitespaces in xpcshell/mochitest profiles - r?florian
Pushed by gsquelart@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/182c7d6d14f3 Profiler gtests compute the proportion of JSON whitespace - r=florian https://hg.mozilla.org/integration/autoland/rev/2b6e8a8a770b JSONWriter() can be single-line from the top, removing the final newline - r=florian https://hg.mozilla.org/integration/autoland/rev/66cc321b2ff6 Make BaseProfileJSONWriter single-lined - r=florian https://hg.mozilla.org/integration/autoland/rev/e12a14c0e1a5 Use single-line JSONWriters in nsProfiler functions - r=florian https://hg.mozilla.org/integration/autoland/rev/b3cfb0d05ed1 Remove whitespaces in gc stats' JSONPrinter - r=florian https://hg.mozilla.org/integration/autoland/rev/25718fed7f54 Output profiling logs in the most compact json - r=florian https://hg.mozilla.org/integration/autoland/rev/4fe98d466d30 If SingleLineStyle is set at construction, also remove spaces after colons and commas - r=florian https://hg.mozilla.org/integration/autoland/rev/1c65183edd44 Remove now-ignored style parameters in ProfileJSONWriter functions - r=florian https://hg.mozilla.org/integration/autoland/rev/8b166af41096 Remove JSONWriter style specifications from profiler code - r=florian https://hg.mozilla.org/integration/autoland/rev/6f369c2cd337 Rework shared test profiler controls - r=florian https://hg.mozilla.org/integration/autoland/rev/4870c2e16d49 Add minimal test for GC and CC markers - r=florian https://hg.mozilla.org/integration/autoland/rev/bf26f05745aa Verify that there are no whitespaces in xpcshell/mochitest profiles - r=florian
Regressions: 1782070
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: