perf: cache manifests in Dataset::load_manifest - #16
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
perf: cache manifests in Dataset::load_manifest#16devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
state-reconciler's provenance walk repeatedly calls checkout_version, which currently re-reads and re-decodes the full manifest each time. The session already has a metadata_cache keyed by (version, e_tag) that caches latest_manifest and transactions. Use it in load_manifest so repeated checkout_version calls for the same version reuse the same Arc<Manifest>. Also updates ethnum 1.5.2 -> 1.5.3, which is required to compile on Rust >= 1.97 (TryFromIntError size changed; see ethnum-rs#58). Test: unit test asserts Arc pointer equality for repeated checkout_version calls.
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
state-reconcilerspends a large share of its tick time in a provenance walk that callsDataset::checkout_version(version)for each version fromcursor..=latest_version_id. Each call currently re-reads and fully decodes the manifest from object storage, even when the same manifest is checked out repeatedly within the same session.The
Sessionalready maintains ametadata_cachekeyed byManifestKey { version, e_tag }forlatest_manifestand transactions. This PR extends that cache toDataset::load_manifestso repeatedcheckout_versioncalls for the same manifest reuse the sameArc<Manifest>instead of re-decoding it.What changed
Dataset::load_manifestnow returnsArc<Manifest>and consults/inserts the session metadata cache before object-store read + decode.Dataset::checkout_manifestandDatasetBuildercallers updated to pass theArc<Manifest>through.load_new_transactionsnow relies onload_manifestfor caching instead of doing a second duplicate insertion.do_commit_new_datasetdeep-clones the manifest from the returnedArc.ethnum1.5.2→1.5.3, which is required to compile the workspace on Rust>= 1.97(upstreamethnum-rs#58).Validation
cargo check -p lancepasses.cargo test -p lance --lib test_checkout_version_uses_manifest_cachepasses, assertingArc::ptr_eqacross repeatedcheckout_versioncalls.dataset_versioningmodule passes.A/B note
This change is the Lance-side fix for the Atlas
state-reconciler-ab-bload-test profile: the provenance walk'sread_manifest/Message::decodeframes should shrink because manifests are loaded once per version and shared across the tick.Link to Devin session: https://app.devin.ai/sessions/0401670882af4a4785541fa753378cda