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

Package index optimization #5

Merged
merged 11 commits into from
Mar 26, 2024
Merged

Conversation

ethangreen-dev
Copy link
Member

@ethangreen-dev ethangreen-dev commented Mar 20, 2024

This PR optimizes package index load and query times by splitting it into two separate files: a lookup table, which allows for time and space efficient package reference lookups, and the index itself, which is read from offsets stored within the lookup table.

These changes supplant the need to load the entire index into memory. This reduces memory usage by at least ~170 MB and greatly improves command -> action runtime latency. This is entirely a result of the lookup table being an order of magnitude smaller than the index itself.

@ethangreen-dev ethangreen-dev marked this pull request as draft March 20, 2024 15:07
src/package/index.rs Fixed Show fixed Hide fixed
src/package/index.rs Fixed Show fixed Hide fixed
src/package/resolver.rs Fixed Show fixed Hide fixed
src/package/resolver.rs Fixed Show fixed Hide fixed
src/package/resolver.rs Fixed Show fixed Hide fixed
src/ts/experimental/index.rs Fixed Show fixed Hide fixed
src/ts/experimental/index.rs Fixed Show fixed Hide fixed
src/ts/experimental/index.rs Fixed Show fixed Hide fixed
src/ts/experimental/index.rs Fixed Show fixed Hide fixed
src/package/index.rs Fixed Show fixed Hide fixed
src/package/index.rs Fixed Show fixed Hide fixed
src/package/index.rs Fixed Show fixed Hide fixed
src/package/index.rs Fixed Show fixed Hide fixed
@ethangreen-dev ethangreen-dev marked this pull request as ready for review March 20, 2024 17:04
@ethangreen-dev ethangreen-dev force-pushed the streamed-package-index branch from b27317e to f88cdb2 Compare March 20, 2024 17:07
@ethangreen-dev ethangreen-dev merged commit 3d1c4df into develop Mar 26, 2024
3 of 5 checks passed
@ethangreen-dev ethangreen-dev deleted the streamed-package-index branch March 26, 2024 17:10
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