Skip to content

feat: cache InnerNodeInner seq to index to make locate faster#20

Closed
EastSun5566 wants to merge 1 commit intomweidner037:masterfrom
EastSun5566:feat/cache-inner-note-inner-seq-to-index
Closed

feat: cache InnerNodeInner seq to index to make locate faster#20
EastSun5566 wants to merge 1 commit intomweidner037:masterfrom
EastSun5566:feat/cache-inner-note-inner-seq-to-index

Conversation

@EastSun5566
Copy link
Copy Markdown
Contributor

@EastSun5566 EastSun5566 commented Dec 9, 2025

When I implemented #18 , I found that locate is heavily used. I added a small cache to InnerNodeInner so finding the index by sequence can be done in O(1). All existing tests have passed.

@mweidner037
Copy link
Copy Markdown
Owner

While this may speed up read-heavy workloads, I don't think it is worth the increased memory usage. Memory usage is the more important constraint in practice when working with large documents.

@EastSun5566
Copy link
Copy Markdown
Contributor Author

Got it! That makes sense. I’ll close this PR.

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.

2 participants