forked from opentibiabr/canary
-
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.
improve: review of everything using set (opentibiabr#1705)
Refactor set implementation across the codebase for optimal performance. Detailed Description: This encompasses a comprehensive review and overhaul of `std::set` usage within the project, replacing it with more efficient collections as applicable. The refactoring targets instances where set operations are utilized, with a critical analysis of performance considerations. Key Changes: • Avoid `std::set` due to ordering overhead when order is not a requirement. • Employ `std::unordered_set` for scenarios with infrequent insertions and deletions but frequent searches. • Integrate `phmap::flat_hash_set` as a balanced option for various operations without linear searches. • Introduce `vector_set` for batch insertions and short-term unique data handling within methods. Performance Insights: The `vector_set` is particularly notable for its batch insertion efficiency and automatic sorting and deduplication upon search or deletion operations, making it suitable for maintaining a unique set of elements temporarily. Example Usage: stdext::vector_set<int> unique_list; unique_list.insertAll({1, 3, 4, 5}); unique_list.insertAll({4, 2, 87, 2}); unique_list.insertAll({3, 1, 99, 5}); unique_list now contains 1, 2, 3, 4, 5, 87, 99 without duplicates
- Loading branch information
Showing
34 changed files
with
192 additions
and
181 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
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
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
Oops, something went wrong.