Closed Bug 1264697 Opened 5 years ago Closed 5 years ago
Investigate a more compact format for all-tests
MozReview Request: Bug 1264697 - Change the format of all-tests.json to reduce redundant data. r=gps
58 bytes, text/x-review-board-request
It is extremely large. Writing it accounts for a significant portion of build-backend, and loading/parsing it accounts for a significant overhead when running tests.
Ok, the simple optimization I had in mind saves about 22mb on disk, so that seems promising.
Unfortunately, while the speed improvements that result (measuring the operations in comment 0) are measurable, they are nowhere near proportional to the space improvement.
The format provided to the build system by the manifest parser is highly redundant: every test lists all variables for that test, and many tests use a large support-files entry in DEFAULT that ends up in individual test objects. This patch stores these DEFAULTS per-manifest rather than per-test to save disk space, resulting in about a ~22mb smaller all-tests.json file. The in-memory representation of tests is not changed by this patch, as the defaults are again propagated to individual tests as all-tests.json is read by the test resolver. Review commit: https://reviewboard.mozilla.org/r/46559/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/46559/
Attachment #8741545 - Flags: review?(gps)
each test also has a path relative to topsrcdir as well as a full absolute path.
Comment on attachment 8741545 [details] MozReview Request: Bug 1264697 - Change the format of all-tests.json to reduce redundant data. r=gps https://reviewboard.mozilla.org/r/46559/#review43453 ::: python/mozbuild/mozbuild/frontend/emitter.py:1083 (Diff revision 1) > + default_support_files = defaults.get('support-files') > + if default_support_files: > + obj.default_support_files = default_support_files You can just assign directly since .get() will default to returning None, which is the default value in the data class. ::: python/mozbuild/mozbuild/testing.py:66 (Diff revision 1) > + manifest = metadata['manifest'] > + support_files = manifest_support_files.get(manifest) > + if support_files and 'support-files' not in metadata: > + metadata['support-files'] = support_files Please add a short inline comment about the new file format.
Attachment #8741545 - Flags: review?(gps) → review+
You need to log in before you can comment on or make changes to this bug.