Skip to content

fix: cache nodes in ProgressiveListBasicTreeView - #553

Merged
wemeetagain merged 2 commits into
masterfrom
te/progressive_list_basic_cache
Oct 6, 2026
Merged

wemeetagain merged 2 commits into
masterfrom
te/progressive_list_basic_cache

Conversation

@twoeths

@twoeths twoeths commented Oct 6, 2026

Copy link
Copy Markdown
Member

Motivation

Description

this branch

packages/ssz/test/perf/eth2/beaconStateGloas.test.ts
  gloas BeaconState balances.get() vc=85453
    ✔ sweep 16384 balances after clone + commit                        1.407584e+8 ops/s    7.104370 ns/op        -       1592 runs  0.330 s

master:

packages/ssz/test/perf/eth2/beaconStateGloas.test.ts
  gloas BeaconState balances.get() vc=85453
    ✔ sweep 16384 balances after clone + commit                            1910852 ops/s    523.3267 ns/op        -         25 runs  0.722 s

part of ChainSafe/lodestar#9866

@twoeths
twoeths requested a review from a team as a code owner October 6, 2026 08:34
@github-actions github-actions Bot added the ssz label Oct 6, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T08:38:43.992967Z dc3f79e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@twoeths twoeths changed the title perf: cache nodes in ProgressiveListBasicTreeView fix: cache nodes in ProgressiveListBasicTreeView Oct 6, 2026
Comment thread packages/ssz/src/type/progressiveList.ts
Comment thread packages/ssz/src/type/progressiveList.ts
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Performance Alert ⚠️

Possible performance regression was detected for some benchmarks.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold.

Benchmark suite Current: 6bbc859 Previous: d5df08a Ratio
struct - increase slot to 1000000 2.6043 ms/op 350.31 us/op 7.43
Full benchmark results
Benchmark suite Current: 6bbc859 Previous: d5df08a Ratio
digestTwoHashObjects 50023 times 40.198 ms/op 38.454 ms/op 1.05
digest2Bytes32 50023 times 43.812 ms/op 42.365 ms/op 1.03
digest 50023 times 42.967 ms/op 41.589 ms/op 1.03
input length 32 949.00 ns/op 915.00 ns/op 1.04
input length 64 1.1000 us/op 1.0350 us/op 1.06
input length 128 1.8710 us/op 1.7850 us/op 1.05
input length 256 2.8140 us/op 2.6350 us/op 1.07
input length 512 4.7190 us/op 4.3970 us/op 1.07
input length 1024 9.0940 us/op 8.3890 us/op 1.08
digest 1000000 times 664.87 ms/op 653.35 ms/op 1.02
hashObjectToByteArray 50023 times 1.0098 ms/op 980.59 us/op 1.03
byteArrayToHashObject 50023 times 1.3336 ms/op 1.0910 ms/op 1.22
digest64 200092 times 173.17 ms/op 165.77 ms/op 1.04
hash 200092 times using batchHash4UintArray64s 87.062 ms/op 181.61 ms/op 0.48
digest64HashObjects 200092 times 161.33 ms/op 155.23 ms/op 1.04
hash 200092 times using batchHash4HashObjectInputs 65.396 ms/op 149.53 ms/op 0.44
getGindicesAtDepth 3.2510 us/op 3.1320 us/op 1.04
iterateAtDepth 6.0300 us/op 6.0970 us/op 0.99
getGindexBits 331.00 ns/op 342.00 ns/op 0.97
gindexIterator 837.00 ns/op 794.00 ns/op 1.05
HashComputationLevel.push then loop 32.792 ms/op 28.799 ms/op 1.14
HashComputation[] push then loop 47.076 ms/op 43.027 ms/op 1.09
hash 2 32 bytes Uint8Array 500000 times - hashtree 141.76 ms/op 149.10 ms/op 0.95
batch hash 16 x 64 Uint8Array 31250 times - hashtree 38.428 ms/op 24.619 ms/op 1.56
hashTwoObjects 500000 times - hashtree 162.79 ms/op 164.68 ms/op 0.99
executeHashComputations - hashtree 9.5664 ms/op 8.1368 ms/op 1.18
hash 2 32 bytes Uint8Array 500000 times - as-sha256 404.98 ms/op 394.64 ms/op 1.03
batch hash 16 x 64 Uint8Array 31250 times - as-sha256 153.10 ms/op 417.72 ms/op 0.37
hashTwoObjects 500000 times - as-sha256 421.23 ms/op 407.58 ms/op 1.03
executeHashComputations - as-sha256 15.543 ms/op 35.109 ms/op 0.44
hash 2 32 bytes Uint8Array 500000 times - noble 1.2414 s/op 1.0904 s/op 1.14
batch hash 16 x 64 Uint8Array 31250 times - noble 1.2014 s/op 1.0260 s/op 1.17
hashTwoObjects 500000 times - noble 2.0364 s/op 1.6512 s/op 1.23
executeHashComputations - noble 31.862 ms/op 30.076 ms/op 1.06
getHashComputations 1.7703 ms/op 2.3161 ms/op 0.76
executeHashComputations 8.6945 ms/op 8.6656 ms/op 1.00
get root 13.398 ms/op 13.779 ms/op 0.97
getNodeH() x7812.5 avg hindex 12.151 us/op 12.207 us/op 1.00
getNodeH() x7812.5 index 0 5.2720 us/op 4.6900 us/op 1.12
getNodeH() x7812.5 index 7 5.2690 us/op 4.6860 us/op 1.12
getNodeH() x7812.5 index 7 with key array 5.2680 us/op 4.6840 us/op 1.12
new LeafNode() x7812.5 272.67 us/op 259.29 us/op 1.05
getHashComputations 250000 nodes 9.7736 ms/op 10.976 ms/op 0.89
batchHash 250000 nodes 72.612 ms/op 67.586 ms/op 1.07
get root 250000 nodes 96.175 ms/op 94.576 ms/op 1.02
getHashComputations 500000 nodes 17.899 ms/op 20.183 ms/op 0.89
batchHash 500000 nodes 163.12 ms/op 166.78 ms/op 0.98
get root 500000 nodes 190.22 ms/op 187.10 ms/op 1.02
getHashComputations 1000000 nodes 30.181 ms/op 43.032 ms/op 0.70
batchHash 1000000 nodes 287.51 ms/op 291.47 ms/op 0.99
get root 1000000 nodes 382.72 ms/op 375.97 ms/op 1.02
multiproof - depth 15, 1 requested leaves 6.6280 us/op 6.4750 us/op 1.02
tree offset multiproof - depth 15, 1 requested leaves 16.123 us/op 15.571 us/op 1.04
compact multiproof - depth 15, 1 requested leaves 2.8700 us/op 2.2930 us/op 1.25
multiproof - depth 15, 2 requested leaves 9.7730 us/op 9.5680 us/op 1.02
tree offset multiproof - depth 15, 2 requested leaves 18.821 us/op 18.474 us/op 1.02
compact multiproof - depth 15, 2 requested leaves 2.8950 us/op 2.3050 us/op 1.26
multiproof - depth 15, 3 requested leaves 13.778 us/op 13.705 us/op 1.01
tree offset multiproof - depth 15, 3 requested leaves 24.170 us/op 23.944 us/op 1.01
compact multiproof - depth 15, 3 requested leaves 3.2590 us/op 2.6060 us/op 1.25
multiproof - depth 15, 4 requested leaves 18.051 us/op 18.295 us/op 0.99
tree offset multiproof - depth 15, 4 requested leaves 29.729 us/op 29.701 us/op 1.00
compact multiproof - depth 15, 4 requested leaves 3.7630 us/op 3.0280 us/op 1.24
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.2060 us/op 4.5830 us/op 1.14
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.2080 us/op 4.5910 us/op 1.13
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.2080 us/op 4.5900 us/op 1.13
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.2060 us/op 4.5950 us/op 1.13
subtreeFillToContents depth 40 count 250000 17.600 ms/op 16.842 ms/op 1.04
setRoot - gindexBitstring 19.663 ms/op 20.723 ms/op 0.95
setRoot - gindex 21.168 ms/op 20.037 ms/op 1.06
getRoot - gindexBitstring 2.1022 ms/op 1.9633 ms/op 1.07
getRoot - gindex 3.0628 ms/op 2.5354 ms/op 1.21
getHashObject then setHashObject 21.911 ms/op 20.330 ms/op 1.08
setNodeWithFn 19.940 ms/op 18.116 ms/op 1.10
getNodeAtDepth depth 0 x100000 221.90 us/op 214.61 us/op 1.03
setNodeAtDepth depth 0 x100000 1.8525 ms/op 1.8721 ms/op 0.99
getNodesAtDepth depth 0 x100000 259.22 us/op 280.61 us/op 0.92
setNodesAtDepth depth 0 x100000 642.06 us/op 715.40 us/op 0.90
getNodeAtDepth depth 1 x100000 266.52 us/op 280.48 us/op 0.95
setNodeAtDepth depth 1 x100000 6.9764 ms/op 7.1060 ms/op 0.98
getNodesAtDepth depth 1 x100000 402.74 us/op 406.08 us/op 0.99
setNodesAtDepth depth 1 x100000 5.8172 ms/op 6.0584 ms/op 0.96
getNodeAtDepth depth 2 x100000 644.32 us/op 701.94 us/op 0.92
setNodeAtDepth depth 2 x100000 13.064 ms/op 14.142 ms/op 0.92
getNodesAtDepth depth 2 x100000 15.744 ms/op 15.291 ms/op 1.03
setNodesAtDepth depth 2 x100000 19.900 ms/op 20.540 ms/op 0.97
tree.getNodesAtDepth - gindexes 5.2367 ms/op 10.719 ms/op 0.49
tree.getNodesAtDepth - push all nodes 1.1904 ms/op 1.1125 ms/op 1.07
tree.getNodesAtDepth - navigation 164.49 us/op 154.35 us/op 1.07
tree.setNodesAtDepth - indexes 649.88 us/op 610.45 us/op 1.06
set at depth 8 729.00 ns/op 651.00 ns/op 1.12
set at depth 16 1.0440 us/op 950.00 ns/op 1.10
set at depth 32 1.7460 us/op 1.5800 us/op 1.11
iterateNodesAtDepth 8 256 11.882 us/op 12.018 us/op 0.99
getNodesAtDepth 8 256 3.2710 us/op 3.1250 us/op 1.05
iterateNodesAtDepth 16 65536 3.5991 ms/op 3.8106 ms/op 0.94
getNodesAtDepth 16 65536 933.27 us/op 967.06 us/op 0.97
iterateNodesAtDepth 32 250000 13.526 ms/op 14.165 ms/op 0.95
getNodesAtDepth 32 250000 3.5608 ms/op 3.6254 ms/op 0.98
iterateNodesAtDepth 40 250000 13.621 ms/op 14.089 ms/op 0.97
getNodesAtDepth 40 250000 3.5433 ms/op 3.6764 ms/op 0.96
250000 validators root getter 97.899 ms/op 98.866 ms/op 0.99
250000 validators batchHash() 66.866 ms/op 73.955 ms/op 0.90
250000 validators hashComputations 8.6064 ms/op 13.204 ms/op 0.65
bitlist bytes to struct (120,90) 322.00 ns/op 365.00 ns/op 0.88
bitlist bytes to tree (120,90) 1.8170 us/op 1.6830 us/op 1.08
bitlist bytes to struct (2048,2048) 667.00 ns/op 769.00 ns/op 0.87
bitlist bytes to tree (2048,2048) 3.1280 us/op 4.1610 us/op 0.75
ByteListType - deserialize 7.3941 ms/op 6.8522 ms/op 1.08
BasicListType - deserialize 9.1552 ms/op 7.1925 ms/op 1.27
ByteListType - serialize 7.4306 ms/op 6.7264 ms/op 1.10
BasicListType - serialize 13.603 ms/op 11.736 ms/op 1.16
BasicListType - tree_convertToStruct 24.853 ms/op 23.285 ms/op 1.07
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 2.9368 ms/op 3.9900 ms/op 0.74
List[uint8, 68719476736] len 300000 ViewDU.get(i) 2.9299 ms/op 3.6821 ms/op 0.80
Array.push len 300000 empty Array - number 4.2883 ms/op 4.5359 ms/op 0.95
Array.set len 300000 from new Array - number 1.0162 ms/op 1.1960 ms/op 0.85
Array.set len 300000 - number 4.2086 ms/op 4.1660 ms/op 1.01
Uint8Array.set len 300000 279.17 us/op 295.62 us/op 0.94
Uint32Array.set len 300000 483.87 us/op 766.57 us/op 0.63
Container({a: uint8, b: uint8}) getViewDU x300000 41.683 ms/op 27.739 ms/op 1.50
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 9.4574 ms/op 9.1437 ms/op 1.03
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 100.96 ms/op 91.965 ms/op 1.10
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 338.98 ms/op 276.32 ms/op 1.23
List(Container) len 300000 ViewDU.get(i) 11.048 ms/op 9.1809 ms/op 1.20
List(Container) len 300000 ViewDU.getReadonly(i) 10.375 ms/op 8.6026 ms/op 1.21
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 15.642 ms/op 15.730 ms/op 0.99
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 4.4465 ms/op 3.7455 ms/op 1.19
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 8.5893 ms/op 8.2306 ms/op 1.04
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 8.1124 ms/op 8.3841 ms/op 0.97
Array.push len 300000 empty Array - object 4.3068 ms/op 4.2568 ms/op 1.01
Array.set len 300000 from new Array - object 1.0945 ms/op 1.0530 ms/op 1.04
Array.set len 300000 - object 4.3546 ms/op 4.3128 ms/op 1.01
cachePermanentRootStruct no cache 2.8560 us/op 2.6260 us/op 1.09
cachePermanentRootStruct with cache 171.00 ns/op 160.00 ns/op 1.07
epochParticipation len 250000 rws 7813 2.3694 ms/op 2.2603 ms/op 1.05
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 4.3152 ms/op 4.1447 ms/op 1.04
BeaconState ViewDU batchHashTreeRoot vc=200000 mod=100000 234.65 ms/op 202.79 ms/op 1.16
BeaconState ViewDU batchHashTreeRoot - commit step vc=200000 mod=100000 199.98 ms/op 169.93 ms/op 1.18
BeaconState ViewDU batchHashTreeRoot - hash step vc=200000 mod=100000 41.268 ms/op 38.063 ms/op 1.08
BeaconState ViewDU hashTreeRoot() vc=200000 mod=100000 674.80 ms/op 658.35 ms/op 1.02
BeaconState ViewDU hashTreeRoot - commit step vc=200000 mod=100000 56.936 ms/op 51.892 ms/op 1.10
BeaconState ViewDU hashTreeRoot - validator tree creation vc=100000 mod=100000 250.20 ms/op 233.40 ms/op 1.07
sweep 16384 balances after clone + commit 30.084 ns/op
deserialize Attestation - tree 3.2850 us/op 3.0350 us/op 1.08
deserialize Attestation - struct 1.7170 us/op 1.6300 us/op 1.05
deserialize Attestation - struct (reuse bytes) 1.2370 us/op 1.1650 us/op 1.06
deserialize SignedAggregateAndProof - tree 4.5710 us/op 4.1850 us/op 1.09
deserialize SignedAggregateAndProof - struct 3.0500 us/op 2.7430 us/op 1.11
deserialize SignedAggregateAndProof - struct (reuse bytes) 1.5990 us/op 1.5280 us/op 1.05
deserialize SyncCommitteeMessage - tree 1.2510 us/op 1.2110 us/op 1.03
deserialize SyncCommitteeMessage - struct 1.0670 us/op 1.0130 us/op 1.05
deserialize SyncCommitteeMessage - struct (reuse bytes) 676.00 ns/op 603.00 ns/op 1.12
deserialize SignedContributionAndProof - tree 2.7170 us/op 2.4700 us/op 1.10
deserialize SignedContributionAndProof - struct 2.4310 us/op 2.3800 us/op 1.02
deserialize SignedContributionAndProof - struct (reuse bytes) 1.1060 us/op 997.00 ns/op 1.11
deserialize SignedBeaconBlock - tree 286.75 us/op 264.03 us/op 1.09
deserialize SignedBeaconBlock - struct 141.46 us/op 133.53 us/op 1.06
deserialize SignedBeaconBlock - struct (reuse bytes) 69.995 us/op 65.505 us/op 1.07
BeaconState vc 300000 - deserialize tree 330.67 ms/op 314.21 ms/op 1.05
BeaconState vc 300000 - serialize tree 109.66 ms/op 107.90 ms/op 1.02
BeaconState.historicalRoots vc 300000 - deserialize tree 650.00 ns/op 655.00 ns/op 0.99
BeaconState.historicalRoots vc 300000 - serialize tree 532.00 ns/op 565.00 ns/op 0.94
BeaconState.validators vc 300000 - deserialize tree 305.94 ms/op 290.46 ms/op 1.05
BeaconState.validators vc 300000 - serialize tree 57.413 ms/op 46.291 ms/op 1.24
BeaconState.balances vc 300000 - deserialize tree 8.6796 ms/op 8.5908 ms/op 1.01
BeaconState.balances vc 300000 - serialize tree 11.871 ms/op 13.855 ms/op 0.86
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 747.36 us/op 683.09 us/op 1.09
BeaconState.previousEpochParticipation vc 300000 - serialize tree 561.20 us/op 562.58 us/op 1.00
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 753.09 us/op 684.37 us/op 1.10
BeaconState.currentEpochParticipation vc 300000 - serialize tree 552.05 us/op 577.34 us/op 0.96
BeaconState.inactivityScores vc 300000 - deserialize tree 8.6147 ms/op 8.3921 ms/op 1.03
BeaconState.inactivityScores vc 300000 - serialize tree 10.200 ms/op 8.4149 ms/op 1.21
hashTreeRoot Attestation - struct 8.1030 us/op 7.8390 us/op 1.03
hashTreeRoot Attestation - tree 7.1850 us/op 7.0720 us/op 1.02
hashTreeRoot SignedAggregateAndProof - struct 11.691 us/op 11.252 us/op 1.04
hashTreeRoot SignedAggregateAndProof - tree 10.833 us/op 10.747 us/op 1.01
hashTreeRoot SyncCommitteeMessage - struct 2.8940 us/op 2.7150 us/op 1.07
hashTreeRoot SyncCommitteeMessage - tree 2.6890 us/op 2.6090 us/op 1.03
hashTreeRoot SignedContributionAndProof - struct 7.1750 us/op 6.8040 us/op 1.05
hashTreeRoot SignedContributionAndProof - tree 7.5070 us/op 7.3980 us/op 1.01
hashTreeRoot SignedBeaconBlock - struct 725.38 us/op 693.52 us/op 1.05
hashTreeRoot SignedBeaconBlock - tree 645.81 us/op 651.34 us/op 0.99
hashTreeRoot Validator - struct 3.8350 us/op 3.4310 us/op 1.12
hashTreeRoot Validator - tree 5.5120 us/op 5.3540 us/op 1.03
BeaconState vc 300000 - hashTreeRoot tree 1.8376 s/op 1.8379 s/op 1.00
BeaconState vc 300000 - batchHashTreeRoot tree 3.6716 s/op 3.4552 s/op 1.06
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 748.00 ns/op 770.00 ns/op 0.97
BeaconState.validators vc 300000 - hashTreeRoot tree 1.8580 s/op 1.8279 s/op 1.02
BeaconState.balances vc 300000 - hashTreeRoot tree 28.044 ms/op 27.802 ms/op 1.01
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 3.4761 ms/op 3.4504 ms/op 1.01
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 3.4844 ms/op 3.4476 ms/op 1.01
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 28.100 ms/op 27.996 ms/op 1.00
hash64 x18 6.3170 us/op 6.5210 us/op 0.97
hashTwoObjects x18 6.2390 us/op 6.2640 us/op 1.00
hash64 x1740 578.43 us/op 619.60 us/op 0.93
hashTwoObjects x1740 578.15 us/op 590.19 us/op 0.98
hash64 x2700000 913.99 ms/op 981.54 ms/op 0.93
hashTwoObjects x2700000 897.27 ms/op 913.26 ms/op 0.98
get_exitEpoch - ContainerType 155.00 ns/op 172.00 ns/op 0.90
get_exitEpoch - ContainerNodeStructType 157.00 ns/op 176.00 ns/op 0.89
set_exitEpoch - ContainerType 170.00 ns/op 194.00 ns/op 0.88
set_exitEpoch - ContainerNodeStructType 160.00 ns/op 183.00 ns/op 0.87
get_pubkey - ContainerType 872.00 ns/op 825.00 ns/op 1.06
get_pubkey - ContainerNodeStructType 153.00 ns/op 167.00 ns/op 0.92
hashTreeRoot - ContainerType 270.00 ns/op 305.00 ns/op 0.89
hashTreeRoot - ContainerNodeStructType 268.00 ns/op 297.00 ns/op 0.90
createProof - ContainerType 3.3210 us/op 3.0820 us/op 1.08
createProof - ContainerNodeStructType 18.761 us/op 17.506 us/op 1.07
serialize - ContainerType 1.5180 us/op 1.4020 us/op 1.08
serialize - ContainerNodeStructType 1.0590 us/op 923.00 ns/op 1.15
set_exitEpoch_and_hashTreeRoot - ContainerType 2.1320 us/op 2.0720 us/op 1.03
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 6.1150 us/op 5.8340 us/op 1.05
doBatchHashTreeRootValidators 4.2820 us/op 3.2320 us/op 1.32
ContainerNodeStructViewDU hashTreeRoot 22.270 us/op 20.774 us/op 1.07
Array - for of 4.5010 us/op 3.4290 us/op 1.31
Array - for(;;) 2.9830 us/op 2.8260 us/op 1.06
basicListValue.readonlyValuesArray() 2.9211 ms/op 3.1763 ms/op 0.92
basicListValue.readonlyValuesArray() + loop all 3.6594 ms/op 4.0139 ms/op 0.91
compositeListValue.readonlyValuesArray() 13.248 ms/op 14.557 ms/op 0.91
compositeListValue.readonlyValuesArray() + loop all 9.7123 ms/op 15.028 ms/op 0.65
Number64UintType - get balances list 2.8630 ms/op 2.6915 ms/op 1.06
Number64UintType - set balances list 9.4455 ms/op 9.8932 ms/op 0.95
Number64UintType - get and increase 10 then set 30.499 ms/op 30.930 ms/op 0.99
Number64UintType - increase 10 using applyDelta 15.098 ms/op 14.868 ms/op 1.02
Number64UintType - increase 10 using applyDeltaInBatch 15.210 ms/op 14.870 ms/op 1.02
tree_newTreeFromUint64Deltas 13.806 ms/op 11.798 ms/op 1.17
unsafeUint8ArrayToTree 21.606 ms/op 21.761 ms/op 0.99
bitLength(50) 171.00 ns/op 193.00 ns/op 0.89
bitLengthStr(50) 175.00 ns/op 196.00 ns/op 0.89
bitLength(8000) 174.00 ns/op 190.00 ns/op 0.92
bitLengthStr(8000) 210.00 ns/op 239.00 ns/op 0.88
bitLength(250000) 175.00 ns/op 190.00 ns/op 0.92
bitLengthStr(250000) 253.00 ns/op 274.00 ns/op 0.92
merkleize 32 chunks 11.031 us/op 11.512 us/op 0.96
merkleizeBlocksBytes 32 chunks 3.6580 us/op 2.6890 us/op 1.36
merkleizeBlockArray 32 chunks 6.0280 us/op 4.9520 us/op 1.22
merkleize 128 chunks 43.840 us/op 45.598 us/op 0.96
merkleizeBlocksBytes 128 chunks 10.407 us/op 6.6610 us/op 1.56
merkleizeBlockArray 128 chunks 18.034 us/op 14.312 us/op 1.26
merkleize 512 chunks 175.82 us/op 182.75 us/op 0.96
merkleizeBlocksBytes 512 chunks 35.947 us/op 21.549 us/op 1.67
merkleizeBlockArray 512 chunks 63.236 us/op 49.756 us/op 1.27
merkleize 1024 chunks 351.83 us/op 369.67 us/op 0.95
merkleizeBlocksBytes 1024 chunks 69.700 us/op 40.733 us/op 1.71
merkleizeBlockArray 1024 chunks 123.11 us/op 96.868 us/op 1.27
floor - Math.floor (53) 0.35988 ns/op 0.35031 ns/op 1.03
floor - << 0 (53) 0.36019 ns/op 0.35035 ns/op 1.03
floor - Math.floor (512) 0.36000 ns/op 0.35031 ns/op 1.03
floor - << 0 (512) 0.35995 ns/op 0.35027 ns/op 1.03
fnIf(0) 1.7867 ns/op 1.5005 ns/op 1.19
fnSwitch(0) 2.5987 ns/op 2.4910 ns/op 1.04
fnObj(0) 0.35993 ns/op 0.35034 ns/op 1.03
fnArr(0) 0.35992 ns/op 0.35030 ns/op 1.03
fnIf(4) 2.3620 ns/op 2.1784 ns/op 1.08
fnSwitch(4) 2.3052 ns/op 2.1792 ns/op 1.06
fnObj(4) 0.35985 ns/op 0.35032 ns/op 1.03
fnArr(4) 0.35998 ns/op 0.35030 ns/op 1.03
fnIf(9) 4.0318 ns/op 3.1104 ns/op 1.30
fnSwitch(9) 2.3031 ns/op 2.1787 ns/op 1.06
fnObj(9) 0.35996 ns/op 0.35041 ns/op 1.03
fnArr(9) 0.35995 ns/op 0.35027 ns/op 1.03
Container {a,b,vec} - as struct x100000 35.943 us/op 34.837 us/op 1.03
Container {a,b,vec} - as tree x100000 662.50 us/op 653.37 us/op 1.01
Container {a,vec,b} - as struct x100000 103.81 us/op 77.232 us/op 1.34
Container {a,vec,b} - as tree x100000 622.69 us/op 1.2394 ms/op 0.50
get 2 props x1000000 - rawObject 290.31 us/op 311.39 us/op 0.93
get 2 props x1000000 - proxy 75.326 ms/op 80.528 ms/op 0.94
get 2 props x1000000 - customObj 313.32 us/op 311.44 us/op 1.01
Simple object binary -> struct 401.00 ns/op 450.00 ns/op 0.89
Simple object binary -> tree_backed 1.0580 us/op 928.00 ns/op 1.14
Simple object struct -> tree_backed 1.5430 us/op 1.4160 us/op 1.09
Simple object tree_backed -> struct 1.3750 us/op 1.2390 us/op 1.11
Simple object struct -> binary 764.00 ns/op 691.00 ns/op 1.11
Simple object tree_backed -> binary 1.1880 us/op 1.0270 us/op 1.16
aggregationBits binary -> struct 327.00 ns/op 366.00 ns/op 0.89
aggregationBits binary -> tree_backed 1.9630 us/op 1.8620 us/op 1.05
aggregationBits struct -> tree_backed 2.4060 us/op 2.1510 us/op 1.12
aggregationBits tree_backed -> struct 921.00 ns/op 874.00 ns/op 1.05
aggregationBits struct -> binary 667.00 ns/op 583.00 ns/op 1.14
aggregationBits tree_backed -> binary 783.00 ns/op 752.00 ns/op 1.04
List(uint8) 100000 binary -> struct 641.01 us/op 705.35 us/op 0.91
List(uint8) 100000 binary -> tree_backed 250.48 us/op 229.31 us/op 1.09
List(uint8) 100000 struct -> tree_backed 1.4843 ms/op 1.5795 ms/op 0.94
List(uint8) 100000 tree_backed -> struct 752.14 us/op 817.48 us/op 0.92
List(uint8) 100000 struct -> binary 1.2322 ms/op 1.3497 ms/op 0.91
List(uint8) 100000 tree_backed -> binary 234.39 us/op 259.07 us/op 0.90
List(uint64Number) 100000 binary -> struct 990.85 us/op 1.0504 ms/op 0.94
List(uint64Number) 100000 binary -> tree_backed 2.0472 ms/op 1.9317 ms/op 1.06
List(uint64Number) 100000 struct -> tree_backed 3.6926 ms/op 3.6338 ms/op 1.02
List(uint64Number) 100000 tree_backed -> struct 1.9740 ms/op 2.0512 ms/op 0.96
List(uint64Number) 100000 struct -> binary 2.5687 ms/op 2.4719 ms/op 1.04
List(uint64Number) 100000 tree_backed -> binary 878.83 us/op 921.25 us/op 0.95
List(Uint64Bigint) 100000 binary -> struct 1.6159 ms/op 1.5805 ms/op 1.02
List(Uint64Bigint) 100000 binary -> tree_backed 2.0512 ms/op 1.9356 ms/op 1.06
List(Uint64Bigint) 100000 struct -> tree_backed 3.5298 ms/op 3.4600 ms/op 1.02
List(Uint64Bigint) 100000 tree_backed -> struct 2.3649 ms/op 2.4536 ms/op 0.96
List(Uint64Bigint) 100000 struct -> binary 2.3011 ms/op 2.3287 ms/op 0.99
List(Uint64Bigint) 100000 tree_backed -> binary 694.82 us/op 1.7662 ms/op 0.39
Vector(Root) 100000 binary -> struct 12.544 ms/op 11.159 ms/op 1.12
Vector(Root) 100000 binary -> tree_backed 19.641 ms/op 18.348 ms/op 1.07
Vector(Root) 100000 struct -> tree_backed 21.905 ms/op 21.069 ms/op 1.04
Vector(Root) 100000 tree_backed -> struct 15.727 ms/op 14.775 ms/op 1.06
Vector(Root) 100000 struct -> binary 6.5279 ms/op 5.3365 ms/op 1.22
Vector(Root) 100000 tree_backed -> binary 4.6089 ms/op 5.2815 ms/op 0.87
List(Validator) 100000 binary -> struct 70.773 ms/op 64.105 ms/op 1.10
List(Validator) 100000 binary -> tree_backed 216.80 ms/op 189.23 ms/op 1.15
List(Validator) 100000 struct -> tree_backed 246.08 ms/op 220.46 ms/op 1.12
List(Validator) 100000 tree_backed -> struct 124.65 ms/op 138.64 ms/op 0.90
List(Validator) 100000 struct -> binary 43.164 ms/op 42.858 ms/op 1.01
List(Validator) 100000 tree_backed -> binary 48.080 ms/op 75.573 ms/op 0.64
List(Validator-NS) 100000 binary -> struct 70.194 ms/op 64.187 ms/op 1.09
List(Validator-NS) 100000 binary -> tree_backed 96.986 ms/op 95.095 ms/op 1.02
List(Validator-NS) 100000 struct -> tree_backed 115.66 ms/op 102.87 ms/op 1.12
List(Validator-NS) 100000 tree_backed -> struct 108.48 ms/op 81.245 ms/op 1.34
List(Validator-NS) 100000 struct -> binary 14.223 ms/op 14.807 ms/op 0.96
List(Validator-NS) 100000 tree_backed -> binary 14.550 ms/op 12.727 ms/op 1.14
get epochStatuses - MutableVector 105.38 us/op 114.39 us/op 0.92
get epochStatuses - ViewDU 175.97 us/op 173.69 us/op 1.01
set epochStatuses - ListTreeView 2.0679 ms/op 1.9010 ms/op 1.09
set epochStatuses - ListTreeView - set() 515.63 us/op 473.67 us/op 1.09
set epochStatuses - ListTreeView - commit() 838.59 us/op 753.68 us/op 1.11
bitstring 441.22 ns/op 462.29 ns/op 0.95
bit mask 7.6739 ns/op 7.2293 ns/op 1.06
struct - increase slot to 1000000 2.6043 ms/op 350.31 us/op 7.43
UintNumberType - increase slot to 1000000 26.526 ms/op 27.142 ms/op 0.98
UintBigintType - increase slot to 1000000 154.56 ms/op 158.51 ms/op 0.98
UintBigint8 x 100000 tree_deserialize 5.1583 ms/op 5.0679 ms/op 1.02
UintBigint8 x 100000 tree_serialize 1.2410 ms/op 1.2690 ms/op 0.98
UintBigint16 x 100000 tree_deserialize 5.2638 ms/op 5.1221 ms/op 1.03
UintBigint16 x 100000 tree_serialize 1.2273 ms/op 1.2890 ms/op 0.95
UintBigint32 x 100000 tree_deserialize 5.0603 ms/op 5.0333 ms/op 1.01
UintBigint32 x 100000 tree_serialize 1.5693 ms/op 1.6266 ms/op 0.96
UintBigint64 x 100000 tree_deserialize 5.3161 ms/op 5.1919 ms/op 1.02
UintBigint64 x 100000 tree_serialize 1.6082 ms/op 1.6368 ms/op 0.98
UintBigint8 x 100000 value_deserialize 394.72 us/op 404.61 us/op 0.98
UintBigint8 x 100000 value_serialize 557.97 us/op 376.75 us/op 1.48
UintBigint16 x 100000 value_deserialize 462.06 us/op 467.05 us/op 0.99
UintBigint16 x 100000 value_serialize 570.91 us/op 365.12 us/op 1.56
UintBigint32 x 100000 value_deserialize 479.22 us/op 467.31 us/op 1.03
UintBigint32 x 100000 value_serialize 602.64 us/op 401.54 us/op 1.50
UintBigint64 x 100000 value_deserialize 537.04 us/op 529.26 us/op 1.01
UintBigint64 x 100000 value_serialize 711.13 us/op 539.49 us/op 1.32
UintBigint8 x 100000 deserialize 2.0010 ms/op 1.9296 ms/op 1.04
UintBigint8 x 100000 serialize 1.6310 ms/op 1.5058 ms/op 1.08
UintBigint16 x 100000 deserialize 2.0941 ms/op 2.0413 ms/op 1.03
UintBigint16 x 100000 serialize 2.8306 ms/op 3.0228 ms/op 0.94
UintBigint32 x 100000 deserialize 2.0103 ms/op 2.0705 ms/op 0.97
UintBigint32 x 100000 serialize 2.5257 ms/op 2.8212 ms/op 0.90
UintBigint64 x 100000 deserialize 2.0311 ms/op 2.0136 ms/op 1.01
UintBigint64 x 100000 serialize 1.5232 ms/op 1.2888 ms/op 1.18
UintBigint128 x 100000 deserialize 2.1951 ms/op 2.2230 ms/op 0.99
UintBigint128 x 100000 serialize 11.026 ms/op 12.116 ms/op 0.91
UintBigint256 x 100000 deserialize 3.0638 ms/op 3.0438 ms/op 1.01
UintBigint256 x 100000 serialize 35.266 ms/op 38.356 ms/op 0.92
Slice from Uint8Array x25000 1.0438 ms/op 939.66 us/op 1.11
Slice from ArrayBuffer x25000 13.180 ms/op 12.009 ms/op 1.10
Slice from ArrayBuffer x25000 + new Uint8Array 24.782 ms/op 16.485 ms/op 1.50
Copy Uint8Array 100000 iterate 986.43 us/op 934.83 us/op 1.06
Copy Uint8Array 100000 slice 243.58 us/op 186.50 us/op 1.31
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 118.08 us/op 74.258 us/op 1.59
Copy Buffer 100000 Uint8Array.prototype.slice.call 117.54 us/op 82.538 us/op 1.42
Copy Uint8Array 100000 slice + set 267.57 us/op 162.94 us/op 1.64
Copy Uint8Array 100000 subarray + set 117.38 us/op 76.734 us/op 1.53
Copy Uint8Array 100000 slice arrayBuffer 120.41 us/op 78.260 us/op 1.54
Uint64 deserialize 100000 - iterate Uint8Array 1.2815 ms/op 1.3182 ms/op 0.97
Uint64 deserialize 100000 - by Uint32A 1.1957 ms/op 1.2877 ms/op 0.93
Uint64 deserialize 100000 - by DataView.getUint32 x2 1.2864 ms/op 1.4291 ms/op 0.90
Uint64 deserialize 100000 - by DataView.getBigUint64 3.4424 ms/op 3.7144 ms/op 0.93
Uint64 deserialize 100000 - by byte 15.247 ms/op 15.842 ms/op 0.96

by benchmarkbot/action

@wemeetagain
wemeetagain merged commit dc7d1e3 into master Oct 6, 2026
11 of 13 checks passed
@wemeetagain
wemeetagain deleted the te/progressive_list_basic_cache branch October 6, 2026 16:43
@github-actions github-actions Bot mentioned this pull request Oct 6, 2026
twoeths pushed a commit that referenced this pull request Oct 7, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>ssz: 1.8.1</summary>

##
[1.8.1](ssz-v1.8.0...ssz-v1.8.1)
(2026-10-06)


### Bug Fixes

* cache nodes in ProgressiveListBasicTreeView
([#553](#553))
([dc7d1e3](dc7d1e3))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
nflaig pushed a commit to ChainSafe/lodestar that referenced this pull request Oct 8, 2026
**Motivation**

- improve performance of `getExpectedWithdrawals()` in lodestar
- see ChainSafe/ssz#553

**Description**

- bump ssz to v1.8.0

Closes #9866

**AI Assistance Disclosure**

- created with the help of Claude

Co-authored-by: twoeths <twoeths@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants