Skip to content

perf(storage): optimize dataset fetching with O(1) lookup#322

Open
beck-8 wants to merge 2 commits intofilecoin-project:masterfrom
beck-8:perf/optimize-get-detailed-data-set
Open

perf(storage): optimize dataset fetching with O(1) lookup#322
beck-8 wants to merge 2 commits intofilecoin-project:masterfrom
beck-8:perf/optimize-get-detailed-data-set

Conversation

@beck-8
Copy link
Contributor

@beck-8 beck-8 commented Feb 4, 2026

#321

  • Refactor getDetailedDataSet to use direct WarmStorageService.getDataSet() instead of fetching all datasets via listDataSets()
  • Add fast path in createStorageContext when dataSetId is explicitly provided, using createStorageContextFromDataSetId helper
  • Directly instantiate StorageContext to bypass SDK's expensive resolveByDataSetId which makes redundant RPC calls
  • Fetch metadata and provider info in parallel for better performance

This significantly speeds up 'dataset show ' and 'add --data-set ' commands by avoiding O(N) dataset scanning and redundant RPC calls.

This was generated for me by claude, and I tested it locally without any problems. If there is anything that does not comply with the specifications, you can directly submit and modify my PR.

- Refactor getDetailedDataSet to use direct WarmStorageService.getDataSet()
  instead of fetching all datasets via listDataSets()
- Add fast path in createStorageContext when dataSetId is explicitly
  provided, using createStorageContextFromDataSetId helper
- Directly instantiate StorageContext to bypass SDK's expensive
  resolveByDataSetId which makes redundant RPC calls
- Fetch metadata and provider info in parallel for better performance

This significantly speeds up 'dataset show <id>' and 'add --data-set <id>'
commands by avoiding O(N) dataset scanning and redundant RPC calls.
@beck-8 beck-8 force-pushed the perf/optimize-get-detailed-data-set branch from a169dce to 1840f61 Compare February 4, 2026 09:43
@rjan90 rjan90 added this to FilOz Feb 5, 2026
@rjan90 rjan90 added this to the M4.5: GA Fast Follows milestone Feb 5, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FilOz Feb 5, 2026
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting Review in FilOz Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🔎 Awaiting Review

Development

Successfully merging this pull request may close these issues.

2 participants