Minimize the amount of schema JSON stored in memory

NEW
Unassigned

Status

P2
normal
a year ago
5 months ago

People

(Reporter: kmag, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

a year ago
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
(Reporter)

Updated

a year ago
Depends on: 1390010

Updated

6 months ago
Product: Toolkit → WebExtensions

Comment 1

5 months ago
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).

Comment 2

5 months ago
(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
You need to log in before you can comment on or make changes to this bug.