Skip to content

Conversation

@ObjectiveCharm
Copy link

I found that in the current len() impl of type GenericBPlusTree in lib.rs traverse and iterate through the structure, I wonder whether it is necessary: I don't fully understand the impl, but I think the insertion and removal methods of GenericBPlusTree is transactional, so I personally thought that if we introduce and maintain a len field, that keeps track of the active element, then the iteration can be avoided in len(), i.e. the time complexity is O(1).
I tried to implement it with AtomicUsize and the corresponding memory order. But I didn't do full integrated tests; rather, I only did unit tests.
Since the preliminary unit test in a multithreading environment is passed, I thought maybe that optimization is feasible? Or I didn't understand the design?

…atomic len field in type GenericBPlusTree. And do some chores like remove undeclared mod bench
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant