Closed Bug 1381711 Opened 7 years ago Closed 4 years ago

Minimize the amount of schema JSON stored in memory

Categories

(WebExtensions :: General, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: kmag, Unassigned)

References

(Blocks 1 open bug)

Details

We currently keep all of our schema JSON data in memory, in its original form, in all processes, for the entire length of the session.

Much of this data, such as description strings and unsupported properties, can be thrown away entirely. A lot of it is only needed in certain process types.

When we load schema data, we should normalize it so that only the actually necessary data is used, and we should filter it so that only the schema data needed in a given process type is actually kept there.
Priority: -- → P2
Depends on: 1390010
Product: Toolkit → WebExtensions
Descriptions are already being stripped as of https://hg.mozilla.org/mozilla-central/rev/f39eaceb3ca0

The schemas also define the types for callback parameters, but these aren't used either.

Is it feasible to add a pre-processing step to the compilation to strip all unnecessary data?
Then we can remove all runtime sanitization logic (stripping license headers/comments, descriptions, and whatever patchwork we come up with to shrink the schema file size).
(In reply to Rob Wu [:robwu] from comment #1)
> The schemas also define the types for callback parameters, but these aren't
> used either.

should have said "in release builds".
Callback parameters are validated in debug builds since https://hg.mozilla.org/mozilla-central/rev/4ca0f86e67cb

"description" is already removed by part 3 of bug 1382645

Process-specific schemas was done in bug 1470783

Unsupported entries will be handled in bug 1601610 .

Status: NEW → RESOLVED
Closed: 4 years ago
Depends on: 1382645, 1470783
Resolution: --- → FIXED
See Also: → 1601610
You need to log in before you can comment on or make changes to this bug.