-
-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize crdt.Array
Data Structure for Improved Performance
#980
Comments
Related to #989 |
Can i try this? |
Intuitively, using BBSTs (Balanced Binary Search Trees) such as Treap, AVL, or LLRB trees, which have an upper bound of |
I have reviewed the Y-fast Trie and the Van Emde Boas Tree. Both of these data structures are designed for integer-based keys, which may not be suitable unless there is a way to efficiently update the key values over a range. Therefore, it seems more practical to experiment with several balanced binary search trees (BBSTs) instead.
|
Description:
The current implementation of
crdt.Array
is based onRGATreeList
, which uses bothSplayTree
andLLRBTree
for internal element retrieval. While this structure works, there's potential for optimization, especially considering the random access nature ofcrdt.Array
operations.The current implementation of
crdt.Array
relies on a data structure calledRGATreeList
, which incorporates bothSplayTree
andLLRBTree
for managing internal elements. While this approach is functional, there's room for improvement, particularly given the random access nature ofcrdt.Array
operations. TheSplayTree
is utilized to locate nodes based on their indices duringDocument.Update
calls, while theLLRBTree
is employed to find nodes according to theirElement.CreatedAt
values in various operations.However, the use of
SplayTree
may not be ideal forcrdt.Array
. Initially designed to efficiently handle text editing workloads, theSplayTree
's characteristic of moving recently accessed nodes to the root could potentially create unnecessary overhead in the context ofcrdt.Array
's random access patterns. This suggests that a different data structure might be more appropriate for optimizing performance.To address this, we propose investigating and implementing an alternative data structure that is better suited to the access patterns of
crdt.Array
. The goal of this change is to enhance the performance of local editing operations, potentially leading to improved efficiency and responsiveness in the system overall.Considerations for Implementation
Why:
Implementing a more fitting data structure for
crdt.Array
will likely improve its performance during local editing, especially given the random access nature of the operations. This optimization will lead to smoother user experiences and better resource management within the application.The text was updated successfully, but these errors were encountered: