-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix accidentally-quadratic complexity of ThreadEntrySet ops in debug
Summary: `ThreadEntrySet::basicSanity()` is linear in the size of the entry-set, and is invoked on every mutation to (and test of!) the entry-set in debug. A sequence of `N` ops then has quadratic complexity `O(N^2)`. As one possible resolution, we scan the entry-set once once every `log(N) / N` times, so that `N` ops has complexity `O(N log(N))` rather than `O(N^2)`. And we randomize the scan so that deterministic bugs may be surfaced that would evade a deterministic scan algorithm. Differential Revision: D66733958 fbshipit-source-id: fb91bf834e6a9221ef012fc8f8cad064b2a8c26c
- Loading branch information
1 parent
be79ab6
commit 36e5c5b
Showing
2 changed files
with
27 additions
and
1 deletion.
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