Refactor the Translations actor to remove memory footprint, and increase performance
Categories
(Firefox :: Translations, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: gregtatum, Assigned: gregtatum)
References
(Regressed 1 open bug)
Details
Attachments
(17 files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
Bug 1837078 - Break out the engine payload loading into a method with profiler markers; r?nordzilla!
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 | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
We need to move more work to the parent and lazy load everything in the child. In addition, we need to memoize everything in the parent so that work isn't done over and over on every page load.
This will hopefully address Bug 1836039 and Bug 1836467.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 1•2 years ago
|
||
Since there is an await in the code, this handler became racy. Checking
the id ensures that only the most recent event is used. This was causing
some automated tests to fail when I changed the underlying
implementation.
Depends on D180468
Assignee | ||
Comment 2•2 years ago
|
||
Depends on D180469
Assignee | ||
Comment 3•2 years ago
|
||
This probably isn't too important, but Set.prototype.has
is faster
than Array.prototoype.includes
. The setters are probably more
expensive, but those aren't in hot paths. This change would only be
noticeable if the lists got longer, but even with only a few items in
the list, .has
is faster.
Depends on D180470
Assignee | ||
Comment 4•2 years ago
|
||
Depends on D180471
Assignee | ||
Comment 5•2 years ago
|
||
Depends on D180472
Assignee | ||
Comment 6•2 years ago
|
||
Depends on D180473
Assignee | ||
Comment 7•2 years ago
|
||
Depends on D180474
Assignee | ||
Comment 8•2 years ago
|
||
Depends on D180475
Assignee | ||
Comment 9•2 years ago
|
||
Depends on D180476
Assignee | ||
Comment 10•2 years ago
|
||
Depends on D180477
Assignee | ||
Comment 11•2 years ago
|
||
Depends on D180478
Assignee | ||
Comment 12•2 years ago
|
||
This will have some eslint errors, and not run correctly, but it makes
the following diff much clearer for what is new code, and what is moved
code.
Depends on D180479
Assignee | ||
Comment 13•2 years ago
|
||
Depends on D180480
Assignee | ||
Comment 14•2 years ago
|
||
Any JS code (including comments) gets loaded into content process memory
for every single content process that is loaded. This patch tries to
reduce this burden as much as possible by moving things into either the
TranslationsParent, or into lazily loaded modules in the child.
This patch also changes the engine caching logic to only allow 1 engine
cache at a time. I was struggling porting over the existing cache to this
strategy, and this felt like a much simpler solution.
Depends on D180481
Assignee | ||
Comment 15•2 years ago
|
||
Depends on D180482
Assignee | ||
Comment 16•2 years ago
|
||
Depends on D180847
Assignee | ||
Comment 17•2 years ago
|
||
This also removes some dead code around clearing the language tag, and
properly lists the required events for the TranslationsChild. I guess
that code was never even running, and I tests it manually after removing
it.
Depends on D180848
Comment 18•2 years ago
|
||
Comment 19•2 years ago
|
||
Backed out for bc failures on browser_test_mixed_content_download.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/36b6a21c7806bf54d03adf205da6f7bcf537d95d
Log link: https://treeherder.mozilla.org/logviewer?job_id=419223471&repo=autoland&lineNumber=10279
Assignee | ||
Updated•2 years ago
|
Comment 20•2 years ago
|
||
![]() |
||
Comment 21•2 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9ecac650e6fa
https://hg.mozilla.org/mozilla-central/rev/cda00c714446
https://hg.mozilla.org/mozilla-central/rev/f90402ee929c
https://hg.mozilla.org/mozilla-central/rev/33c5c63fb8be
https://hg.mozilla.org/mozilla-central/rev/177dbec0fb98
https://hg.mozilla.org/mozilla-central/rev/b727be4caaa6
https://hg.mozilla.org/mozilla-central/rev/9d2c3ef9ebf3
https://hg.mozilla.org/mozilla-central/rev/ba3465f86326
https://hg.mozilla.org/mozilla-central/rev/5268b542e1c6
https://hg.mozilla.org/mozilla-central/rev/facbc44bba8c
https://hg.mozilla.org/mozilla-central/rev/4efd0a919db3
https://hg.mozilla.org/mozilla-central/rev/7b9f3e6ac0ed
https://hg.mozilla.org/mozilla-central/rev/7da78f67d716
https://hg.mozilla.org/mozilla-central/rev/3df1f1fd5e1c
https://hg.mozilla.org/mozilla-central/rev/ccd6c3d67650
https://hg.mozilla.org/mozilla-central/rev/a503e6e1f6f4
https://hg.mozilla.org/mozilla-central/rev/a0a479ff9216
Description
•