Closed
Bug 1449220
Opened 6 years ago
Closed 6 years ago
ModuleBuilder import/export lookup uses linear search
Categories
(Core :: JavaScript Engine, enhancement, P2)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla61
Tracking | Status | |
---|---|---|
firefox61 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
10.13 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
When creating module metadata we maintain vectors of import and export entry objects which we search using linear search in a couple of places. This happens to check whether an export is re-exporting an import and when we hit a new export statement the parser to check for duplicate exported names. This leads to N^2 behaviour and is bound to cause problems for large modules.
Assignee | ||
Comment 1•6 years ago
|
||
Patch to use hash tables for import / entry lookup in ModuleBuilder. importEntries_ uses a map as we have to lookup an object by name. For exports there is not always a name (in the case of |export *|) so I added a separate set for exported names. I removed importedBoundNames_ which was unused. I also had to update a test that assumed importEntries would be present in a certain order.
Attachment #8962754 -
Flags: review?(jorendorff)
Updated•6 years ago
|
Priority: -- → P2
Updated•6 years ago
|
Attachment #8962754 -
Flags: review?(jorendorff) → review+
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/627599ba1f3b Use hash tables for looking up imports and exports when building module metadata r=jorendorff
Comment 3•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/627599ba1f3b
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox61:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in
before you can comment on or make changes to this bug.
Description
•