Skip to content

[PERF] Make IO accesses parallel #4988

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

Merged
merged 2 commits into from
Jun 29, 2025

Conversation

sanketkedia
Copy link
Contributor

@sanketkedia sanketkedia commented Jun 29, 2025

Description of changes

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Getting version of a point from the versions map blockfile was sequential. Made it parallel I/O
    • Similarly the final hydration of results in projection was sequential that is converted to parallel
  • New functionality
    • ...

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

None

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sanketkedia sanketkedia marked this pull request as ready for review June 29, 2025 05:57
Copy link
Contributor

Parallelize IO in Projection and Spann Index for Performance Improvements

This PR refactors key IO operations in the projection operator and Spann index reader to use parallel async patterns instead of sequential execution. The main changes include making version lookups from the versions map blockfile and hydration of projection results fully parallel, leading to potential performance improvements in high-IO workloads.

Key Changes:
• Refactored hydration of records in rust/worker/src/execution/operators/projection.rs to use try_join_all for parallel async processing.
• Modified version fetch in rust/index/src/spann/types.rs, changing sequential fetching of versions for doc_offset_ids to a parallel future::try_join_all aggregation.
• Introduced or refactored helper methods to enable parallelism while maintaining correct record and version matching.
• Improved handling of empty input scenarios for projection execution.
• Added use of futures::future in both modules and related imports.

Affected Areas:
• Projection operator logic (hydration of records)
• Spann index reader fetch_posting_list and version map access
• Async IO patterns throughout relevant code

This summary was automatically generated by @propel-code-bot

@sanketkedia sanketkedia changed the title [ENH] Make IO patterns parallel [ENH] Make IO accesses parallel Jun 29, 2025
@sanketkedia sanketkedia changed the title [ENH] Make IO accesses parallel [PERF] Make IO accesses parallel Jun 29, 2025
@sanketkedia sanketkedia merged commit 48cd49d into main Jun 29, 2025
57 of 58 checks passed
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
## Description of changes

_Summarize the changes made by this PR._

- Improvements & Bug fixes
- Getting version of a point from the versions map blockfile was
sequential. Made it parallel I/O
- Similarly the final hydration of results in projection was sequential
that is converted to parallel
- New functionality
  - ...

## Test plan

_How are these changes tested?_
- [x] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes
None
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