Skip to content

perf(core): speed-up raw import#1099

Draft
0xdeafbeef wants to merge 1 commit into
masterfrom
0xdeafbeef/push-uukquppuqzmo
Draft

perf(core): speed-up raw import#1099
0xdeafbeef wants to merge 1 commit into
masterfrom
0xdeafbeef/push-uukquppuqzmo

Conversation

@0xdeafbeef

Copy link
Copy Markdown
Member

Raw Persistent State Import Benchmark

Benchmarked on downloaded testnet persistent state:

  • block: -1:8000000000000000:20768185:...
  • cells: 41,701,776
  • input BOC: 1,892,012,163 bytes
  • temp cell payload bytes: 2,248,610,105

Result

metric baseline new path change
raw import elapsed 1002.125s 236.687s 4.23x faster, -76.4%
test wall time 1020.91s 239.18s 4.27x faster
apply cells 738.133s 134.552s 5.49x faster, -81.8%
temp cell lookup/load 589.186s 0.208s worker-summed effectively removed
temp CF batch writes 182.228s 0s removed
finalize cells 66.305s 61.038s -7.9%
canonical write batches 4171 419 ~10x fewer

What changed

Instead of reading every temp cell back from RocksDB during finalization, the import path now builds an indexed byte store and applies cells directly from it.

Also we traverse the tree in parallel now.

The main wins are:

  • no RocksDB point reads from temp_cells during apply
  • no redundant temp_cells materialization writes
  • fewer canonical RocksDB write batches
  • parallel traversal over finalized temp cells

todo: use rocksdb based on free ram. Now it uses 7gib for 41m cell state.

@github-actions

Copy link
Copy Markdown

🧪 Network Tests

To run network tests for this PR, use:

gh workflow run network-tests.yml -f pr_number=1099

Available test options:

  • Run all tests: gh workflow run network-tests.yml -f pr_number=1099
  • Run specific test: gh workflow run network-tests.yml -f pr_number=1099 -f test_selection=ping-pong

Test types: destroyable, ping-pong, one-to-many-internal-messages, fq-deploy, nft-index, persistent-sync

Results will be posted as workflow runs in the Actions tab.

@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.34356% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.14%. Comparing base (bf5b7a5) to head (784c2fb).
⚠️ Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
core/src/storage/shard_state/cell_storage/raw.rs 89.40% 16 Missing and 16 partials ⚠️
core/src/storage/shard_state/store_state_raw.rs 75.00% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1099      +/-   ##
==========================================
+ Coverage   60.10%   60.14%   +0.04%     
==========================================
  Files         473      474       +1     
  Lines       80197    80848     +651     
  Branches    80197    80848     +651     
==========================================
+ Hits        48200    48625     +425     
- Misses      29681    29878     +197     
- Partials     2316     2345      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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