Skip to content

feat: add ephemeral fields to Container#527

Draft
twoeths wants to merge 1 commit into
masterfrom
te/container_ephemeral_fields
Draft

feat: add ephemeral fields to Container#527
twoeths wants to merge 1 commit into
masterfrom
te/container_ephemeral_fields

Conversation

@twoeths
Copy link
Copy Markdown
Contributor

@twoeths twoeths commented May 8, 2026

Summary

  • Adds an optional ephemeralFields map to ContainerType and ContainerNodeStructType for declaring application-only fields that are first-class on the value/View/ViewDU but strictly excluded from consensus: serialization, deserialization, hashTreeRoot, JSON, equality, and tree storage all ignore them.
  • Lets callers cache derived data (precomputed indices, totals, etc.) directly on a container without forking the type.
  • Non-breaking: new generic EphemeralFields defaults to Record<string, never>, so existing call sites compile unchanged.

Motivation

ContainerType<Fields> currently requires every declared field to participate in consensus. Applications that want to attach derived/cached data on top of a container value have no first-class place to put it — they either fork the SSZ type, attach untyped sidebands, or wrap the type. This PR makes that pattern first-class.

Concrete consumer: ChainSafe/lodestar#9341 — pending deposit requests are currently re-validated on every access. With this PR, lodestar can attach {valid: BooleanType} as an ephemeral field on PendingDeposit, validate once, and cache the result on the container value/View/ViewDU without polluting the consensus type or its hash.

API

new ContainerType(consensusFields, {
  ephemeralFields: { totalActiveBalance: UintNum64, ... },
});
  • Value type widens to ValueOfFields<F> & Partial<ValueOfFields<EF>> (consensus required, ephemerals optional).
  • View/ViewDU expose ephemeral accessors backed by per-instance storage (ephemeralValues); they never touch the merkle tree, \nodesChanged, or viewsChanged`.
  • clone(value) deep-copies present ephemerals via each ephemeral type's own clone.
  • toView(value) / toViewDU(value) carry present ephemerals from the source value to the resulting view's ephemeral storage. getView(tree) / `getViewDU(node)\ start with empty ephemerals (no value source).
  • Constructor throws if an ephemeral name collides with a consensus field name.
  • Avoid ephemeral names that collide with View/ViewDU base members (type, tree, node, cache, nodes, …) — they already exist on the view classes.

Excluded from consensus (verified by tests)

  • serialize / deserialize — ephemerals never appear in bytes; deserialized values have no ephemeral keys
  • hashTreeRoot — identical regardless of ephemeral values
  • equals — compares consensus only; differing ephemerals are still equal
  • toJson / fromJson — ephemerals are not part of JSON encoding
  • defaultValue — emits no ephemeral keys
  • maxChunkCount / depth /fixedSize / serdes layout — derived from consensus fields only

🤖 Generated with Claude Code

@github-actions github-actions Bot added the ssz label May 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 7bdeb97 Previous: 07fb121 Ratio
digestTwoHashObjects 50023 times 45.660 ms/op 47.915 ms/op 0.95
digest2Bytes32 50023 times 51.097 ms/op 54.633 ms/op 0.94
digest 50023 times 50.162 ms/op 53.090 ms/op 0.94
input length 32 1.1990 us/op 1.1970 us/op 1.00
input length 64 1.3260 us/op 1.3520 us/op 0.98
input length 128 2.2320 us/op 2.2800 us/op 0.98
input length 256 3.3020 us/op 3.4090 us/op 0.97
input length 512 5.3340 us/op 5.6230 us/op 0.95
input length 1024 10.223 us/op 10.612 us/op 0.96
digest 1000000 times 804.87 ms/op 875.73 ms/op 0.92
hashObjectToByteArray 50023 times 1.0395 ms/op 938.49 us/op 1.11
byteArrayToHashObject 50023 times 1.5142 ms/op 1.3024 ms/op 1.16
digest64 200092 times 200.44 ms/op 215.79 ms/op 0.93
hash 200092 times using batchHash4UintArray64s 224.87 ms/op 232.96 ms/op 0.97
digest64HashObjects 200092 times 181.29 ms/op 191.29 ms/op 0.95
hash 200092 times using batchHash4HashObjectInputs 189.99 ms/op 191.55 ms/op 0.99
getGindicesAtDepth 4.1110 us/op 3.5510 us/op 1.16
iterateAtDepth 7.1450 us/op 6.4280 us/op 1.11
getGindexBits 499.00 ns/op 454.00 ns/op 1.10
gindexIterator 1.0530 us/op 906.00 ns/op 1.16
HashComputationLevel.push then loop 32.067 ms/op 25.657 ms/op 1.25
HashComputation[] push then loop 50.988 ms/op 37.143 ms/op 1.37
hash 2 32 bytes Uint8Array 500000 times - hashtree 150.39 ms/op 150.01 ms/op 1.00
batch hash 16 x 64 Uint8Array 31250 times - hashtree 26.755 ms/op 24.421 ms/op 1.10
hashTwoObjects 500000 times - hashtree 177.06 ms/op 167.01 ms/op 1.06
executeHashComputations - hashtree 10.046 ms/op 8.9507 ms/op 1.12
hash 2 32 bytes Uint8Array 500000 times - as-sha256 463.74 ms/op 489.72 ms/op 0.95
batch hash 16 x 64 Uint8Array 31250 times - as-sha256 512.62 ms/op 495.49 ms/op 1.03
hashTwoObjects 500000 times - as-sha256 479.54 ms/op 507.78 ms/op 0.94
executeHashComputations - as-sha256 44.023 ms/op 44.882 ms/op 0.98
hash 2 32 bytes Uint8Array 500000 times - noble 1.3545 s/op 1.2256 s/op 1.11
batch hash 16 x 64 Uint8Array 31250 times - noble 1.2680 s/op 1.1632 s/op 1.09
hashTwoObjects 500000 times - noble 1.7176 s/op 1.5204 s/op 1.13
executeHashComputations - noble 34.857 ms/op 36.088 ms/op 0.97
getHashComputations 2.6206 ms/op 2.1336 ms/op 1.23
executeHashComputations 10.836 ms/op 9.6364 ms/op 1.12
get root 12.338 ms/op 12.648 ms/op 0.98
getNodeH() x7812.5 avg hindex 13.824 us/op 12.254 us/op 1.13
getNodeH() x7812.5 index 0 8.4170 us/op 7.4880 us/op 1.12
getNodeH() x7812.5 index 7 8.5130 us/op 7.5300 us/op 1.13
getNodeH() x7812.5 index 7 with key array 7.0490 us/op 6.2770 us/op 1.12
new LeafNode() x7812.5 359.80 us/op 307.00 us/op 1.17
getHashComputations 250000 nodes 17.385 ms/op 14.811 ms/op 1.17
batchHash 250000 nodes 89.343 ms/op 84.659 ms/op 1.06
get root 250000 nodes 92.602 ms/op 95.076 ms/op 0.97
getHashComputations 500000 nodes 36.813 ms/op 28.583 ms/op 1.29
batchHash 500000 nodes 186.34 ms/op 148.96 ms/op 1.25
get root 500000 nodes 186.42 ms/op 196.24 ms/op 0.95
getHashComputations 1000000 nodes 79.214 ms/op 56.188 ms/op 1.41
batchHash 1000000 nodes 372.94 ms/op 355.89 ms/op 1.05
get root 1000000 nodes 379.54 ms/op 378.63 ms/op 1.00
multiproof - depth 15, 1 requested leaves 8.6840 us/op 7.3290 us/op 1.18
tree offset multiproof - depth 15, 1 requested leaves 18.298 us/op 16.758 us/op 1.09
compact multiproof - depth 15, 1 requested leaves 4.6260 us/op 3.4180 us/op 1.35
multiproof - depth 15, 2 requested leaves 12.180 us/op 10.749 us/op 1.13
tree offset multiproof - depth 15, 2 requested leaves 22.096 us/op 20.137 us/op 1.10
compact multiproof - depth 15, 2 requested leaves 4.6260 us/op 3.2570 us/op 1.42
multiproof - depth 15, 3 requested leaves 17.725 us/op 15.314 us/op 1.16
tree offset multiproof - depth 15, 3 requested leaves 29.132 us/op 26.062 us/op 1.12
compact multiproof - depth 15, 3 requested leaves 6.1030 us/op 3.7540 us/op 1.63
multiproof - depth 15, 4 requested leaves 22.766 us/op 20.132 us/op 1.13
tree offset multiproof - depth 15, 4 requested leaves 35.664 us/op 31.876 us/op 1.12
compact multiproof - depth 15, 4 requested leaves 5.1530 us/op 4.1740 us/op 1.23
packedRootsBytesToLeafNodes bytes 4000 offset 0 7.1030 us/op 5.6630 us/op 1.25
packedRootsBytesToLeafNodes bytes 4000 offset 1 6.9040 us/op 5.7120 us/op 1.21
packedRootsBytesToLeafNodes bytes 4000 offset 2 6.8640 us/op 5.6850 us/op 1.21
packedRootsBytesToLeafNodes bytes 4000 offset 3 7.1520 us/op 5.7070 us/op 1.25
subtreeFillToContents depth 40 count 250000 54.238 ms/op 48.202 ms/op 1.13
setRoot - gindexBitstring 21.390 ms/op 20.198 ms/op 1.06
setRoot - gindex 21.481 ms/op 19.883 ms/op 1.08
getRoot - gindexBitstring 2.4850 ms/op 2.3568 ms/op 1.05
getRoot - gindex 3.1595 ms/op 2.9568 ms/op 1.07
getHashObject then setHashObject 21.920 ms/op 20.355 ms/op 1.08
setNodeWithFn 19.681 ms/op 18.265 ms/op 1.08
getNodeAtDepth depth 0 x100000 257.44 us/op 280.61 us/op 0.92
setNodeAtDepth depth 0 x100000 2.0479 ms/op 2.2398 ms/op 0.91
getNodesAtDepth depth 0 x100000 306.01 us/op 312.64 us/op 0.98
setNodesAtDepth depth 0 x100000 878.79 us/op 761.45 us/op 1.15
getNodeAtDepth depth 1 x100000 320.75 us/op 342.60 us/op 0.94
setNodeAtDepth depth 1 x100000 8.2399 ms/op 7.7272 ms/op 1.07
getNodesAtDepth depth 1 x100000 412.53 us/op 436.34 us/op 0.95
setNodesAtDepth depth 1 x100000 7.2241 ms/op 6.2632 ms/op 1.15
getNodeAtDepth depth 2 x100000 670.72 us/op 840.44 us/op 0.80
setNodeAtDepth depth 2 x100000 14.952 ms/op 14.458 ms/op 1.03
getNodesAtDepth depth 2 x100000 16.579 ms/op 16.326 ms/op 1.02
setNodesAtDepth depth 2 x100000 22.186 ms/op 21.660 ms/op 1.02
tree.getNodesAtDepth - gindexes 10.142 ms/op 7.4951 ms/op 1.35
tree.getNodesAtDepth - push all nodes 2.1676 ms/op 1.8890 ms/op 1.15
tree.getNodesAtDepth - navigation 354.73 us/op 312.31 us/op 1.14
tree.setNodesAtDepth - indexes 706.53 us/op 634.32 us/op 1.11
set at depth 8 803.00 ns/op 784.00 ns/op 1.02
set at depth 16 1.1610 us/op 1.1000 us/op 1.06
set at depth 32 2.0970 us/op 1.8690 us/op 1.12
iterateNodesAtDepth 8 256 13.942 us/op 13.453 us/op 1.04
getNodesAtDepth 8 256 3.7690 us/op 3.5440 us/op 1.06
iterateNodesAtDepth 16 65536 4.5496 ms/op 4.2754 ms/op 1.06
getNodesAtDepth 16 65536 1.7867 ms/op 1.1099 ms/op 1.61
iterateNodesAtDepth 32 250000 16.431 ms/op 15.643 ms/op 1.05
getNodesAtDepth 32 250000 5.0513 ms/op 4.4346 ms/op 1.14
iterateNodesAtDepth 40 250000 16.891 ms/op 15.695 ms/op 1.08
getNodesAtDepth 40 250000 6.0993 ms/op 4.4623 ms/op 1.37
250000 validators root getter 96.329 ms/op 95.848 ms/op 1.01
250000 validators batchHash() 108.55 ms/op 80.944 ms/op 1.34
250000 validators hashComputations 19.000 ms/op 14.537 ms/op 1.31
bitlist bytes to struct (120,90) 604.00 ns/op 488.00 ns/op 1.24
bitlist bytes to tree (120,90) 2.7620 us/op 2.1350 us/op 1.29
bitlist bytes to struct (2048,2048) 1.0150 us/op 867.00 ns/op 1.17
bitlist bytes to tree (2048,2048) 4.4370 us/op 3.5940 us/op 1.23
ByteListType - deserialize 10.495 ms/op 7.9144 ms/op 1.33
BasicListType - deserialize 14.355 ms/op 9.9586 ms/op 1.44
ByteListType - serialize 10.758 ms/op 7.9185 ms/op 1.36
BasicListType - serialize 12.636 ms/op 9.6603 ms/op 1.31
BasicListType - tree_convertToStruct 25.286 ms/op 21.030 ms/op 1.20
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 6.5750 ms/op 5.0595 ms/op 1.30
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.9128 ms/op 4.3942 ms/op 1.12
Array.push len 300000 empty Array - number 8.8837 ms/op 6.4381 ms/op 1.38
Array.set len 300000 from new Array - number 2.7957 ms/op 2.0644 ms/op 1.35
Array.set len 300000 - number 8.2952 ms/op 6.3628 ms/op 1.30
Uint8Array.set len 300000 329.16 us/op 374.16 us/op 0.88
Uint32Array.set len 300000 501.04 us/op 432.51 us/op 1.16
Container({a: uint8, b: uint8}) getViewDU x300000 49.370 ms/op 29.634 ms/op 1.67
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 17.246 ms/op 10.539 ms/op 1.64
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 271.21 ms/op 200.23 ms/op 1.35
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 278.98 ms/op 229.83 ms/op 1.21
List(Container) len 300000 ViewDU.get(i) 8.8430 ms/op 6.4768 ms/op 1.37
List(Container) len 300000 ViewDU.getReadonly(i) 9.1037 ms/op 6.4676 ms/op 1.41
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 69.173 ms/op 37.227 ms/op 1.86
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 7.9282 ms/op 4.8968 ms/op 1.62
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 8.2759 ms/op 6.0215 ms/op 1.37
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 8.1604 ms/op 6.0288 ms/op 1.35
Array.push len 300000 empty Array - object 8.1174 ms/op 5.9920 ms/op 1.35
Array.set len 300000 from new Array - object 2.0690 ms/op 1.9911 ms/op 1.04
Array.set len 300000 - object 6.8469 ms/op 5.7659 ms/op 1.19
cachePermanentRootStruct no cache 3.3840 us/op 3.1350 us/op 1.08
cachePermanentRootStruct with cache 186.00 ns/op 190.00 ns/op 0.98
epochParticipation len 250000 rws 7813 2.5824 ms/op 2.3554 ms/op 1.10
Deneb BeaconBlock.hashTreeRoot(), numTransaction=200 4.9695 ms/op 4.5896 ms/op 1.08
BeaconState ViewDU batchHashTreeRoot vc=200000 mod=100000 235.05 ms/op 212.66 ms/op 1.11
BeaconState ViewDU batchHashTreeRoot - commit step vc=200000 mod=100000 200.38 ms/op 175.34 ms/op 1.14
BeaconState ViewDU batchHashTreeRoot - hash step vc=200000 mod=100000 50.447 ms/op 47.893 ms/op 1.05
BeaconState ViewDU hashTreeRoot() vc=200000 mod=100000 726.49 ms/op 682.79 ms/op 1.06
BeaconState ViewDU hashTreeRoot - commit step vc=200000 mod=100000 77.599 ms/op 62.858 ms/op 1.23
BeaconState ViewDU hashTreeRoot - validator tree creation vc=100000 mod=100000 293.20 ms/op 264.08 ms/op 1.11
deserialize Attestation - tree 3.8670 us/op 3.5800 us/op 1.08
deserialize Attestation - struct 2.1210 us/op 1.9190 us/op 1.11
deserialize Attestation - struct (reuse bytes) 1.6160 us/op 1.4660 us/op 1.10
deserialize SignedAggregateAndProof - tree 5.2890 us/op 4.6540 us/op 1.14
deserialize SignedAggregateAndProof - struct 3.2230 us/op 3.0110 us/op 1.07
deserialize SignedAggregateAndProof - struct (reuse bytes) 2.1690 us/op 1.8960 us/op 1.14
deserialize SyncCommitteeMessage - tree 1.5960 us/op 1.3820 us/op 1.15
deserialize SyncCommitteeMessage - struct 1.2160 us/op 1.0700 us/op 1.14
deserialize SyncCommitteeMessage - struct (reuse bytes) 791.00 ns/op 737.00 ns/op 1.07
deserialize SignedContributionAndProof - tree 2.8930 us/op 2.7780 us/op 1.04
deserialize SignedContributionAndProof - struct 2.6520 us/op 2.3140 us/op 1.15
deserialize SignedContributionAndProof - struct (reuse bytes) 1.3800 us/op 1.2230 us/op 1.13
deserialize SignedBeaconBlock - tree 286.75 us/op 269.57 us/op 1.06
deserialize SignedBeaconBlock - struct 123.84 us/op 121.31 us/op 1.02
deserialize SignedBeaconBlock - struct (reuse bytes) 80.011 us/op 77.650 us/op 1.03
BeaconState vc 300000 - deserialize tree 689.01 ms/op 623.88 ms/op 1.10
BeaconState vc 300000 - serialize tree 89.334 ms/op 92.651 ms/op 0.96
BeaconState.historicalRoots vc 300000 - deserialize tree 1.0130 us/op 925.00 ns/op 1.10
BeaconState.historicalRoots vc 300000 - serialize tree 747.00 ns/op 656.00 ns/op 1.14
BeaconState.validators vc 300000 - deserialize tree 642.28 ms/op 571.80 ms/op 1.12
BeaconState.validators vc 300000 - serialize tree 40.476 ms/op 35.698 ms/op 1.13
BeaconState.balances vc 300000 - deserialize tree 28.493 ms/op 28.095 ms/op 1.01
BeaconState.balances vc 300000 - serialize tree 4.1657 ms/op 3.5188 ms/op 1.18
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.0429 ms/op 870.58 us/op 1.20
BeaconState.previousEpochParticipation vc 300000 - serialize tree 333.11 us/op 324.11 us/op 1.03
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.0121 ms/op 880.92 us/op 1.15
BeaconState.currentEpochParticipation vc 300000 - serialize tree 331.50 us/op 322.89 us/op 1.03
BeaconState.inactivityScores vc 300000 - deserialize tree 30.195 ms/op 24.827 ms/op 1.22
BeaconState.inactivityScores vc 300000 - serialize tree 4.1115 ms/op 3.6257 ms/op 1.13
hashTreeRoot Attestation - struct 10.023 us/op 9.2150 us/op 1.09
hashTreeRoot Attestation - tree 7.4180 us/op 7.4240 us/op 1.00
hashTreeRoot SignedAggregateAndProof - struct 12.620 us/op 12.275 us/op 1.03
hashTreeRoot SignedAggregateAndProof - tree 11.048 us/op 11.085 us/op 1.00
hashTreeRoot SyncCommitteeMessage - struct 3.3400 us/op 3.0230 us/op 1.10
hashTreeRoot SyncCommitteeMessage - tree 2.9060 us/op 2.7760 us/op 1.05
hashTreeRoot SignedContributionAndProof - struct 8.0320 us/op 7.4780 us/op 1.07
hashTreeRoot SignedContributionAndProof - tree 7.6660 us/op 7.6360 us/op 1.00
hashTreeRoot SignedBeaconBlock - struct 767.62 us/op 725.65 us/op 1.06
hashTreeRoot SignedBeaconBlock - tree 644.63 us/op 662.24 us/op 0.97
hashTreeRoot Validator - struct 4.4110 us/op 4.2590 us/op 1.04
hashTreeRoot Validator - tree 6.0100 us/op 5.7480 us/op 1.05
BeaconState vc 300000 - hashTreeRoot tree 2.1033 s/op 1.9695 s/op 1.07
BeaconState vc 300000 - batchHashTreeRoot tree 4.2916 s/op 3.8337 s/op 1.12
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 932.00 ns/op 821.00 ns/op 1.14
BeaconState.validators vc 300000 - hashTreeRoot tree 2.2865 s/op 2.0979 s/op 1.09
BeaconState.balances vc 300000 - hashTreeRoot tree 27.742 ms/op 28.348 ms/op 0.98
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 3.4328 ms/op 3.5386 ms/op 0.97
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 3.4379 ms/op 3.5385 ms/op 0.97
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 29.494 ms/op 30.139 ms/op 0.98
hash64 x18 8.0160 us/op 7.3500 us/op 1.09
hashTwoObjects x18 6.5890 us/op 6.5890 us/op 1.00
hash64 x1740 712.30 us/op 631.65 us/op 1.13
hashTwoObjects x1740 606.58 us/op 590.06 us/op 1.03
hash64 x2700000 1.0706 s/op 979.43 ms/op 1.09
hashTwoObjects x2700000 934.80 ms/op 916.75 ms/op 1.02
get_exitEpoch - ContainerType 306.00 ns/op 261.00 ns/op 1.17
get_exitEpoch - ContainerNodeStructType 247.00 ns/op 269.00 ns/op 0.92
set_exitEpoch - ContainerType 277.00 ns/op 250.00 ns/op 1.11
set_exitEpoch - ContainerNodeStructType 260.00 ns/op 247.00 ns/op 1.05
get_pubkey - ContainerType 1.0130 us/op 891.00 ns/op 1.14
get_pubkey - ContainerNodeStructType 237.00 ns/op 236.00 ns/op 1.00
hashTreeRoot - ContainerType 507.00 ns/op 429.00 ns/op 1.18
hashTreeRoot - ContainerNodeStructType 503.00 ns/op 425.00 ns/op 1.18
createProof - ContainerType 4.1420 us/op 3.5820 us/op 1.16
createProof - ContainerNodeStructType 20.133 us/op 19.300 us/op 1.04
serialize - ContainerType 1.8350 us/op 1.6050 us/op 1.14
serialize - ContainerNodeStructType 1.2830 us/op 1.0970 us/op 1.17
set_exitEpoch_and_hashTreeRoot - ContainerType 2.7340 us/op 2.4020 us/op 1.14
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 7.0380 us/op 6.3980 us/op 1.10
doBatchHashTreeRootValidators 3.8460 us/op 3.5730 us/op 1.08
ContainerNodeStructViewDU hashTreeRoot 23.641 us/op 21.640 us/op 1.09
Array - for of 6.2130 us/op 9.0710 us/op 0.68
Array - for(;;) 5.7230 us/op 9.3490 us/op 0.61
basicListValue.readonlyValuesArray() 3.9662 ms/op 3.9874 ms/op 0.99
basicListValue.readonlyValuesArray() + loop all 4.0888 ms/op 4.3818 ms/op 0.93
compositeListValue.readonlyValuesArray() 64.547 ms/op 29.873 ms/op 2.16
compositeListValue.readonlyValuesArray() + loop all 64.570 ms/op 30.376 ms/op 2.13
Number64UintType - get balances list 5.1410 ms/op 4.3414 ms/op 1.18
Number64UintType - set balances list 10.269 ms/op 10.117 ms/op 1.02
Number64UintType - get and increase 10 then set 40.374 ms/op 37.387 ms/op 1.08
Number64UintType - increase 10 using applyDelta 15.018 ms/op 14.255 ms/op 1.05
Number64UintType - increase 10 using applyDeltaInBatch 15.464 ms/op 14.344 ms/op 1.08
tree_newTreeFromUint64Deltas 23.778 ms/op 20.980 ms/op 1.13
unsafeUint8ArrayToTree 36.740 ms/op 33.514 ms/op 1.10
bitLength(50) 269.00 ns/op 247.00 ns/op 1.09
bitLengthStr(50) 249.00 ns/op 213.00 ns/op 1.17
bitLength(8000) 268.00 ns/op 236.00 ns/op 1.14
bitLengthStr(8000) 305.00 ns/op 272.00 ns/op 1.12
bitLength(250000) 264.00 ns/op 229.00 ns/op 1.15
bitLengthStr(250000) 329.00 ns/op 321.00 ns/op 1.02
merkleize 32 chunks 12.963 us/op 12.575 us/op 1.03
merkleizeBlocksBytes 32 chunks 3.2230 us/op 3.0580 us/op 1.05
merkleizeBlockArray 32 chunks 6.4370 us/op 5.9560 us/op 1.08
merkleize 128 chunks 48.530 us/op 48.738 us/op 1.00
merkleizeBlocksBytes 128 chunks 7.8390 us/op 7.2760 us/op 1.08
merkleizeBlockArray 128 chunks 18.241 us/op 16.693 us/op 1.09
merkleize 512 chunks 200.09 us/op 194.37 us/op 1.03
merkleizeBlocksBytes 512 chunks 24.501 us/op 22.424 us/op 1.09
merkleizeBlockArray 512 chunks 63.016 us/op 57.437 us/op 1.10
merkleize 1024 chunks 398.72 us/op 388.75 us/op 1.03
merkleizeBlocksBytes 1024 chunks 47.550 us/op 42.484 us/op 1.12
merkleizeBlockArray 1024 chunks 123.00 us/op 111.92 us/op 1.10
floor - Math.floor (53) 1.2356 ns/op 1.2455 ns/op 0.99
floor - << 0 (53) 1.2536 ns/op 1.2445 ns/op 1.01
floor - Math.floor (512) 1.2499 ns/op 1.2444 ns/op 1.00
floor - << 0 (512) 1.2400 ns/op 1.2456 ns/op 1.00
fnIf(0) 1.7162 ns/op 1.5552 ns/op 1.10
fnSwitch(0) 2.2898 ns/op 2.1794 ns/op 1.05
fnObj(0) 1.7653 ns/op 1.5578 ns/op 1.13
fnArr(0) 1.7613 ns/op 1.5573 ns/op 1.13
fnIf(4) 2.2896 ns/op 2.1830 ns/op 1.05
fnSwitch(4) 2.2892 ns/op 2.1800 ns/op 1.05
fnObj(4) 1.7611 ns/op 1.5581 ns/op 1.13
fnArr(4) 1.7595 ns/op 1.5596 ns/op 1.13
fnIf(9) 3.1698 ns/op 3.1110 ns/op 1.02
fnSwitch(9) 2.2876 ns/op 2.1782 ns/op 1.05
fnObj(9) 1.7712 ns/op 1.5594 ns/op 1.14
fnArr(9) 1.7601 ns/op 1.5580 ns/op 1.13
Container {a,b,vec} - as struct x100000 141.13 us/op 124.64 us/op 1.13
Container {a,b,vec} - as tree x100000 563.69 us/op 560.34 us/op 1.01
Container {a,vec,b} - as struct x100000 159.70 us/op 155.91 us/op 1.02
Container {a,vec,b} - as tree x100000 599.16 us/op 560.59 us/op 1.07
get 2 props x1000000 - rawObject 354.98 us/op 312.07 us/op 1.14
get 2 props x1000000 - proxy 72.137 ms/op 72.446 ms/op 1.00
get 2 props x1000000 - customObj 352.44 us/op 311.87 us/op 1.13
Simple object binary -> struct 615.00 ns/op 608.00 ns/op 1.01
Simple object binary -> tree_backed 1.9940 us/op 1.6070 us/op 1.24
Simple object struct -> tree_backed 2.6040 us/op 2.1160 us/op 1.23
Simple object tree_backed -> struct 1.7220 us/op 1.4860 us/op 1.16
Simple object struct -> binary 939.00 ns/op 859.00 ns/op 1.09
Simple object tree_backed -> binary 1.3530 us/op 1.2110 us/op 1.12
aggregationBits binary -> struct 559.00 ns/op 474.00 ns/op 1.18
aggregationBits binary -> tree_backed 2.3120 us/op 2.0430 us/op 1.13
aggregationBits struct -> tree_backed 2.8510 us/op 2.4470 us/op 1.17
aggregationBits tree_backed -> struct 1.1000 us/op 965.00 ns/op 1.14
aggregationBits struct -> binary 778.00 ns/op 694.00 ns/op 1.12
aggregationBits tree_backed -> binary 972.00 ns/op 824.00 ns/op 1.18
List(uint8) 100000 binary -> struct 1.0784 ms/op 989.10 us/op 1.09
List(uint8) 100000 binary -> tree_backed 336.97 us/op 266.49 us/op 1.26
List(uint8) 100000 struct -> tree_backed 1.4278 ms/op 1.3083 ms/op 1.09
List(uint8) 100000 tree_backed -> struct 1.0754 ms/op 955.94 us/op 1.12
List(uint8) 100000 struct -> binary 1.0777 ms/op 1.0490 ms/op 1.03
List(uint8) 100000 tree_backed -> binary 98.944 us/op 107.46 us/op 0.92
List(uint64Number) 100000 binary -> struct 1.4648 ms/op 1.2471 ms/op 1.17
List(uint64Number) 100000 binary -> tree_backed 5.4910 ms/op 4.1656 ms/op 1.32
List(uint64Number) 100000 struct -> tree_backed 7.4612 ms/op 6.1502 ms/op 1.21
List(uint64Number) 100000 tree_backed -> struct 2.7631 ms/op 2.2902 ms/op 1.21
List(uint64Number) 100000 struct -> binary 1.3905 ms/op 1.3964 ms/op 1.00
List(uint64Number) 100000 tree_backed -> binary 1.1723 ms/op 1.0192 ms/op 1.15
List(Uint64Bigint) 100000 binary -> struct 3.9699 ms/op 3.6155 ms/op 1.10
List(Uint64Bigint) 100000 binary -> tree_backed 5.3942 ms/op 4.3767 ms/op 1.23
List(Uint64Bigint) 100000 struct -> tree_backed 7.2287 ms/op 6.9597 ms/op 1.04
List(Uint64Bigint) 100000 tree_backed -> struct 5.2624 ms/op 4.5863 ms/op 1.15
List(Uint64Bigint) 100000 struct -> binary 2.0461 ms/op 2.0919 ms/op 0.98
List(Uint64Bigint) 100000 tree_backed -> binary 1.2446 ms/op 1.0588 ms/op 1.18
Vector(Root) 100000 binary -> struct 37.514 ms/op 32.616 ms/op 1.15
Vector(Root) 100000 binary -> tree_backed 41.606 ms/op 30.839 ms/op 1.35
Vector(Root) 100000 struct -> tree_backed 51.136 ms/op 47.758 ms/op 1.07
Vector(Root) 100000 tree_backed -> struct 53.661 ms/op 48.017 ms/op 1.12
Vector(Root) 100000 struct -> binary 2.9035 ms/op 2.9848 ms/op 0.97
Vector(Root) 100000 tree_backed -> binary 7.5062 ms/op 6.1972 ms/op 1.21
List(Validator) 100000 binary -> struct 122.05 ms/op 98.371 ms/op 1.24
List(Validator) 100000 binary -> tree_backed 360.39 ms/op 307.81 ms/op 1.17
List(Validator) 100000 struct -> tree_backed 382.16 ms/op 354.49 ms/op 1.08
List(Validator) 100000 tree_backed -> struct 222.15 ms/op 209.39 ms/op 1.06
List(Validator) 100000 struct -> binary 29.299 ms/op 29.985 ms/op 0.98
List(Validator) 100000 tree_backed -> binary 117.03 ms/op 107.83 ms/op 1.09
List(Validator-NS) 100000 binary -> struct 117.17 ms/op 98.614 ms/op 1.19
List(Validator-NS) 100000 binary -> tree_backed 168.50 ms/op 149.43 ms/op 1.13
List(Validator-NS) 100000 struct -> tree_backed 195.49 ms/op 182.02 ms/op 1.07
List(Validator-NS) 100000 tree_backed -> struct 159.49 ms/op 148.83 ms/op 1.07
List(Validator-NS) 100000 struct -> binary 7.4758 ms/op 7.8260 ms/op 0.96
List(Validator-NS) 100000 tree_backed -> binary 14.186 ms/op 12.255 ms/op 1.16
get epochStatuses - MutableVector 91.381 us/op 98.454 us/op 0.93
get epochStatuses - ViewDU 180.86 us/op 177.94 us/op 1.02
set epochStatuses - ListTreeView 2.2169 ms/op 2.0582 ms/op 1.08
set epochStatuses - ListTreeView - set() 380.99 us/op 444.86 us/op 0.86
set epochStatuses - ListTreeView - commit() 799.80 us/op 783.67 us/op 1.02
bitstring 543.31 ns/op 509.82 ns/op 1.07
bit mask 12.677 ns/op 13.452 ns/op 0.94
struct - increase slot to 1000000 1.0558 ms/op 933.96 us/op 1.13
UintNumberType - increase slot to 1000000 29.545 ms/op 27.865 ms/op 1.06
UintBigintType - increase slot to 1000000 191.23 ms/op 166.38 ms/op 1.15
UintBigint8 x 100000 tree_deserialize 6.2878 ms/op 5.5161 ms/op 1.14
UintBigint8 x 100000 tree_serialize 649.77 us/op 1.1297 ms/op 0.58
UintBigint16 x 100000 tree_deserialize 6.3019 ms/op 5.6109 ms/op 1.12
UintBigint16 x 100000 tree_serialize 1.5315 ms/op 1.3324 ms/op 1.15
UintBigint32 x 100000 tree_deserialize 6.1610 ms/op 5.4576 ms/op 1.13
UintBigint32 x 100000 tree_serialize 1.9785 ms/op 1.6808 ms/op 1.18
UintBigint64 x 100000 tree_deserialize 6.8099 ms/op 6.2629 ms/op 1.09
UintBigint64 x 100000 tree_serialize 1.9120 ms/op 1.6767 ms/op 1.14
UintBigint8 x 100000 value_deserialize 422.52 us/op 405.29 us/op 1.04
UintBigint8 x 100000 value_serialize 898.88 us/op 743.36 us/op 1.21
UintBigint16 x 100000 value_deserialize 459.07 us/op 467.13 us/op 0.98
UintBigint16 x 100000 value_serialize 922.30 us/op 781.99 us/op 1.18
UintBigint32 x 100000 value_deserialize 475.74 us/op 498.10 us/op 0.96
UintBigint32 x 100000 value_serialize 967.94 us/op 824.02 us/op 1.17
UintBigint64 x 100000 value_deserialize 543.13 us/op 531.68 us/op 1.02
UintBigint64 x 100000 value_serialize 1.1868 ms/op 960.18 us/op 1.24
UintBigint8 x 100000 deserialize 3.8284 ms/op 3.0531 ms/op 1.25
UintBigint8 x 100000 serialize 1.8915 ms/op 1.5097 ms/op 1.25
UintBigint16 x 100000 deserialize 3.8965 ms/op 3.0698 ms/op 1.27
UintBigint16 x 100000 serialize 1.8779 ms/op 1.5930 ms/op 1.18
UintBigint32 x 100000 deserialize 3.9527 ms/op 3.1287 ms/op 1.26
UintBigint32 x 100000 serialize 2.8958 ms/op 2.8248 ms/op 1.03
UintBigint64 x 100000 deserialize 4.6450 ms/op 3.8174 ms/op 1.22
UintBigint64 x 100000 serialize 1.6487 ms/op 1.6565 ms/op 1.00
UintBigint128 x 100000 deserialize 6.2816 ms/op 5.4874 ms/op 1.14
UintBigint128 x 100000 serialize 15.085 ms/op 14.809 ms/op 1.02
UintBigint256 x 100000 deserialize 9.3398 ms/op 8.4498 ms/op 1.11
UintBigint256 x 100000 serialize 43.316 ms/op 44.416 ms/op 0.98
Slice from Uint8Array x25000 1.5534 ms/op 1.3078 ms/op 1.19
Slice from ArrayBuffer x25000 15.963 ms/op 15.603 ms/op 1.02
Slice from ArrayBuffer x25000 + new Uint8Array 17.196 ms/op 15.565 ms/op 1.10
Copy Uint8Array 100000 iterate 1.7368 ms/op 1.6744 ms/op 1.04
Copy Uint8Array 100000 slice 80.088 us/op 96.492 us/op 0.83
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 90.587 us/op 98.231 us/op 0.92
Copy Buffer 100000 Uint8Array.prototype.slice.call 93.915 us/op 97.004 us/op 0.97
Copy Uint8Array 100000 slice + set 215.15 us/op 193.96 us/op 1.11
Copy Uint8Array 100000 subarray + set 83.002 us/op 97.334 us/op 0.85
Copy Uint8Array 100000 slice arrayBuffer 82.319 us/op 97.246 us/op 0.85
Uint64 deserialize 100000 - iterate Uint8Array 2.2866 ms/op 1.9144 ms/op 1.19
Uint64 deserialize 100000 - by Uint32A 2.2528 ms/op 1.8379 ms/op 1.23
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.2776 ms/op 1.8307 ms/op 1.24
Uint64 deserialize 100000 - by DataView.getBigUint64 5.1756 ms/op 4.9276 ms/op 1.05
Uint64 deserialize 100000 - by byte 43.995 ms/op 40.441 ms/op 1.09

by benchmarkbot/action

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.

1 participant