Optimize ThreadActor._mapSourceToAddon
Categories
(DevTools :: Debugger, enhancement, P2)
Tracking
(firefox67 fixed)
Tracking | Status | |
---|---|---|
firefox67 | --- | fixed |
People
(Reporter: ochameau, Assigned: ochameau)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
SourceActor._mapSourceToAddon:
https://searchfox.org/mozilla-central/rev/c07aaf12f13037c1f5a343d31f8291549e57373f/devtools/server/actors/source.js#243-290
This function is called for all sources on SourceActor instantiation:
https://searchfox.org/mozilla-central/rev/c07aaf12f13037c1f5a343d31f8291549e57373f/devtools/server/actors/source.js#153
But it is:
- only useful for add-ons
- slow to execute
We should:
- bail out the earliest/fastest when we know it isn't an addon resource
- even if this is an add-on resource, optimize this computation
We can surely optimize it if we merge SourceActor._mapSourceToAddon with mapURIToAddonId:
https://searchfox.org/mozilla-central/source/devtools/server/actors/utils/map-uri-to-addon-id.js#34-42
And adapt this code to the fact that we only support WebExtension add-ons.
The possible URL scheme for WebExtension is most likely much simplier and probably restricted to only one kind.
Also WebExtensionPolicy.getByURI may be faster than the original platform method we used to call when we orignaly wrote this helper method.
Assignee | ||
Comment 1•5 years ago
|
||
Oh wait, it is even much more simple. We aren't using "addonPath". We return it in the form, but never use it elsewhere.
https://searchfox.org/mozilla-central/search?q=addonPath&case=false®exp=false&path=devtools%2F
It looks like we can remove a lot of code.
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Comment 4•5 years ago
|
||
Pushed by apoirot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bfdfbd4fa2ce Remove unused addonID/addonPath from SourceActor. r=jlast
Comment 6•5 years ago
|
||
bugherder |
Description
•