perf: potentially-unsafe deduplication of addon instances - #2759
Open
runspired wants to merge 1 commit into
Open
perf: potentially-unsafe deduplication of addon instances#2759runspired wants to merge 1 commit into
runspired wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is part of a series of optimizations I've found while working on diagnosing why the v1-compat portion of a v2 addon test build was crashing with a stack-overflow after 30min. This series of optimizations now has that same build completing start-to-finish (not just compat) in 45s. This particular optimization drops the time taken from 4min (after array spread optimizations) to 3min. It overlaps partially with #2755 - so the total improvement here is a bit smaller once that PR's effects are taken into account.
I'm relatively sure this is not safe. Today (no-dedupe) is imo an over-eager attempt at maximal correctness. There is a completely correct solution somewhere between "just one instance" and "68,900 instances" of the same addon. This also does not fix a similar problem higher up the tree: it solves for these wrappers but we're still doing a ton of addon instance generation (and babel plugin creation to support such) before this on a similar over-eager number of instances.