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

fix(core): Improve performance for Tantivy indexValues call #1867

Merged
merged 3 commits into from
Oct 11, 2024

Conversation

rfairfax
Copy link
Contributor

@rfairfax rfairfax commented Oct 7, 2024

indexValues was falling way behind Lucene due to a few reasons:

  1. We were copying results directly into Java objects, which was incurring a lot of JNI back and forth overhead
  2. When querying the entire index we were looking at docs instead of the reverse index, which increased the count of items to process

This PR does a few things:

  1. Add perf benchmarks for the missing functions
  2. Add a new IndexCollector trait that can be used to walk the index vs docs
  3. Remove the JNI object usage in indexValues vs byte serialized data
  4. Return encoded string arrays instead of creating JVM strings in native code
  5. Glue all these optimizations togther.

With this Tantivy is still a bit behind Lucene for this path, but it's almost 100x faster than before.

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?

indexValues was falling way behind Lucene due to a few reasons:

1. We were copying results directly into Java objects, which was incurring a lot of JNI back and forth overhead
2. When querying the entire index we were looking at docs instead of the reverse index, which increased
   the count of items to process

This PR does a few things:

1. Add perf benchmarks for the missing functions
2. Add a new IndexCollector trait that can be used to walk the index vs docs
3. Remove the JNI object usage in indexValues vs byte serialized data
4. Glue all these optimizations togther.

With this Tantivy is still a bit behind Lucene for this path, but it's almost 100x faster
than before.
@rfairfax rfairfax merged commit 80a37ac into filodb:develop Oct 11, 2024
1 check passed
@rfairfax rfairfax deleted the rfairfax/indexValues branch October 11, 2024 16:20
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