-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1892589 - Custom Highlight API: Implemented speedup for `Highligh…
…t::Add()`. r=edgar,dom-core To preserve uniqueness in the mirrored data structure for the JS-setlike object, `nsTArray::Contains()` was used. This showed up in profiles due to its `O(n)` time complexity. Performance could be improved by replacing it with `SetlikeHelpers::Has()`, which uses the more efficient version of the underlying data structure of the setlike. The same idea has been applied to `HighlightRegistry`, which uses a maplike. However, this is mostly for consistency, since `Highlight::Add()` will likely be called more often and hence the bigger performance bottleneck. Differential Revision: https://phabricator.services.mozilla.com/D208071
- Loading branch information
1 parent
8a91117
commit 2946822
Showing
2 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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