Skip to content
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

Slow new trx indexing #96

Open
d-r-q opened this issue May 25, 2020 · 0 comments
Open

Slow new trx indexing #96

d-r-q opened this issue May 25, 2020 · 0 comments
Labels
Milestone

Comments

@d-r-q
Copy link
Owner

d-r-q commented May 25, 2020

Currently Index is implemented using HashMap, so when new facts are indexed, the whole map is copied (i.e. on each commit). It leads to slow commit performance. Reimplement Index using some persistent data structure. It may be persistent map from https://github.com/Kotlin/kotlinx.collections.immutable or old qbit's btree: https://github.com/d-r-q/qbit/blob/btree/src/main/kotlin/qbit/collections/btree.kt

For btree, the are some suggestions

  1. remove rebalancing on delete. Since it will be ever growing data structure
  2. probably, add mutable builder. Not sure that it's possible, look at https://github.com/Kotlin/kotlinx.collections.immutable#persistent-collection-builder-interfaces - probably there will be some hints
@d-r-q d-r-q added this to the Backlog milestone May 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant