Investigate implementing TypeScript handling for XPCOMUtils.defineLazyGetter / defineLazyPreferenceGetter / defineLazyServiceGetter etc
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Tracking
(firefox139 fixed)
| Tracking | Status | |
|---|---|---|
| firefox139 | --- | fixed |
People
(Reporter: standard8, Assigned: zombie)
References
(Blocks 2 open bugs)
Details
(Keywords: perf-alert, Whiteboard: [addons-jira])
Attachments
(1 file, 1 obsolete file)
Investigating SearchService.sys.mjs with TypeScript I get various issues raised as a result of TypeScript not knowing about how the various XPCOMUtils.defineLazyGetter / defineLazyPreferenceGetter / defineLazyServiceGetter etc methods work.
We should investigate if there's a way we can make this work, or if we'll need to replace this with standards based functionality.
| Assignee | ||
Comment 1•1 year ago
|
||
Prototype of a type-friendly design for handling all of the different
kinds of lazy imports and getters.
Updated•1 year ago
|
| Assignee | ||
Comment 2•1 year ago
|
||
Note: this patch is just a demo for a possible type-friendly design for
different lazy things we need in gecko. It's not meant to be production
quality, the purpose is to gather feedback.
See also D238131 for another approach we're considering.
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 3•1 year ago
•
|
||
Here is some prior art within the devtools' performance-new code:
https://searchfox.org/mozilla-central/source/devtools/client/performance-new/shared/typescript-lazy-load.sys.mjs
This can be used this way:
https://searchfox.org/mozilla-central/rev/dd8b5213e4e7760b5fe5743fbc313398b85f8a14/devtools/client/performance-new/shared/background.sys.mjs#88-108
The various goals were:
- should support different ways of importing (devtools'
requireas well as the usual Firefox way with ChromeUtils) - should allow for typescript types
- not too magic (ie: prefer code over configuration)
It makes it more verbose than the alternatives, but also easier to understand for the users. It also works with more cases.
Updated•1 year ago
|
Comment 5•1 year ago
|
||
| bugherder | ||
Comment 6•1 year ago
|
||
(In reply to Pulsebot from comment #4)
Pushed by tjovanovic@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/526b3d0ba7eb
Design type-friendly XPCOM.declareLazy() r=Standard8,arai,mossop
Perfherder has detected a talos performance change from push 526b3d0ba7ebe24e98aad3e1535e586927651821.
If you have any questions, please reach out to a performance sheriff. Alternatively, you can find help on Slack by joining #perf-help, and on Matrix you can find help by joining #perftest.
Improvements:
| Ratio | Test | Platform | Options | Absolute values (old vs new) |
|---|---|---|---|---|
| 25% | ts_paint | linux1804-64-shippable-qr | e10s fission stylo webrender | 707.83 -> 532.25 |
| 18% | sessionrestore_many_windows | linux1804-64-shippable-qr | e10s fission stylo webrender-sw | 981.42 -> 806.42 |
| 18% | sessionrestore_many_windows | linux1804-64-shippable-qr | e10s fission stylo webrender | 1,022.00 -> 842.08 |
| 17% | sessionrestore | linux1804-64-shippable-qr | e10s fission stylo webrender | 1,027.83 -> 851.75 |
| 17% | sessionrestore_no_auto_restore | linux1804-64-shippable-qr | e10s fission stylo webrender | 1,049.17 -> 875.92 |
| ... | ... | ... | ... | ... |
| 14% | startup_about_home_paint_realworld_webextensions | linux1804-64-shippable-qr | e10s fission stylo webrender | 1,214.92 -> 1,040.08 |
Details of the alert can be found in the alert summary, including links to graphs and comparisons for each of the affected tests.
If you need the profiling jobs you can trigger them yourself from treeherder job view or ask a performance sheriff to do that for you.
You can run all of these tests on try with ./mach try perf --alert 44625
The following documentation link provides more information about this command.
Description
•