-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Store vtables sorted in Rust builder (#6765)
* benchmark many vtables * Rust: Store written_table rev-positions sorted. The previous implementation was slow if there were too many tables. Asymototically when inserting the n^th vtable: The old implementation took O(n) lookup steps and O(1) insertion. The new implementation is O(log n) lookup and O(n) insertion. This might be improved further by using a balanced btree. Benchmarking, create_many_tables is 7.5x faster (on my laptop): // Simple vector cache test create_many_tables ... bench: 728,875 ns/iter (+/- 12,279) = 44 MB/s // Sorted vector cache test create_many_tables ... bench: 97,843 ns/iter (+/- 4,430) = 334 MB/s * Fix lints Co-authored-by: Casper Neo <cneo@google.com>
- Loading branch information
Showing
4 changed files
with
51 additions
and
60 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
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