Skip to content

Commit

Permalink
chore: copy latest ssz types from lodestar (#333)
Browse files Browse the repository at this point in the history
* chore: copy latest lodestarTypes

* chore: spec test v1.4.0-beta.1

* fix: add missing types
  • Loading branch information
twoeths authored Sep 13, 2023
1 parent 64c1305 commit 0d60dd0
Show file tree
Hide file tree
Showing 30 changed files with 1,620 additions and 132 deletions.
1 change: 1 addition & 0 deletions packages/ssz/test/lodestarTypes/allForks/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from "./types";
export * as ts from "./types";
export * as ssz from "./sszTypes";
131 changes: 129 additions & 2 deletions packages/ssz/test/lodestarTypes/allForks/sszTypes.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* eslint-disable @typescript-eslint/naming-convention */

import {ssz as phase0} from "../phase0";
import {ssz as altair} from "../altair";
import {ssz as bellatrix} from "../bellatrix";
import {ssz as capella} from "../capella";
import {ssz as deneb} from "../deneb";

/**
* Index the ssz types that differ by fork
Expand Down Expand Up @@ -30,4 +30,131 @@ export const allForks = {
BeaconState: bellatrix.BeaconState,
Metadata: altair.Metadata,
},
capella: {
BeaconBlockBody: capella.BeaconBlockBody,
BeaconBlock: capella.BeaconBlock,
SignedBeaconBlock: capella.SignedBeaconBlock,
BeaconState: capella.BeaconState,
Metadata: altair.Metadata,
},
deneb: {
BeaconBlockBody: deneb.BeaconBlockBody,
BeaconBlock: deneb.BeaconBlock,
SignedBeaconBlock: deneb.SignedBeaconBlock,
BeaconState: deneb.BeaconState,
Metadata: altair.Metadata,
},
};

/**
* Index the execution ssz types that differ by fork
* A record of AllForksExecutionSSZTypes indexed by fork
*/
export const allForksExecution = {
bellatrix: {
BeaconBlockBody: bellatrix.BeaconBlockBody,
BeaconBlock: bellatrix.BeaconBlock,
SignedBeaconBlock: bellatrix.SignedBeaconBlock,
BeaconState: bellatrix.BeaconState,
ExecutionPayload: bellatrix.ExecutionPayload,
ExecutionPayloadHeader: bellatrix.ExecutionPayloadHeader,
BuilderBid: bellatrix.BuilderBid,
SignedBuilderBid: bellatrix.SignedBuilderBid,
SSEPayloadAttributes: bellatrix.SSEPayloadAttributes,
},
capella: {
BeaconBlockBody: capella.BeaconBlockBody,
BeaconBlock: capella.BeaconBlock,
SignedBeaconBlock: capella.SignedBeaconBlock,
BeaconState: capella.BeaconState,
// Not used in phase0 but added for type consitency
ExecutionPayload: capella.ExecutionPayload,
ExecutionPayloadHeader: capella.ExecutionPayloadHeader,
BuilderBid: capella.BuilderBid,
SignedBuilderBid: capella.SignedBuilderBid,
SSEPayloadAttributes: capella.SSEPayloadAttributes,
},
deneb: {
BeaconBlockBody: deneb.BeaconBlockBody,
BeaconBlock: deneb.BeaconBlock,
SignedBeaconBlock: deneb.SignedBeaconBlock,
BeaconState: deneb.BeaconState,
ExecutionPayload: deneb.ExecutionPayload,
ExecutionPayloadHeader: deneb.ExecutionPayloadHeader,
BuilderBid: deneb.BuilderBid,
SignedBuilderBid: deneb.SignedBuilderBid,
SSEPayloadAttributes: deneb.SSEPayloadAttributes,
},
};

/**
* Index the blinded ssz types that differ by fork
* A record of AllForksBlindedSSZTypes indexed by fork
*/
export const allForksBlinded = {
bellatrix: {
BeaconBlockBody: bellatrix.BlindedBeaconBlockBody,
BeaconBlock: bellatrix.BlindedBeaconBlock,
SignedBeaconBlock: bellatrix.SignedBlindedBeaconBlock,
},
capella: {
BeaconBlockBody: capella.BlindedBeaconBlockBody,
BeaconBlock: capella.BlindedBeaconBlock,
SignedBeaconBlock: capella.SignedBlindedBeaconBlock,
},
deneb: {
BeaconBlockBody: deneb.BlindedBeaconBlockBody,
BeaconBlock: deneb.BlindedBeaconBlock,
SignedBeaconBlock: deneb.SignedBlindedBeaconBlock,
},
};

export const allForksLightClient = {
altair: {
BeaconBlock: altair.BeaconBlock,
BeaconBlockBody: altair.BeaconBlockBody,
LightClientHeader: altair.LightClientHeader,
LightClientBootstrap: altair.LightClientBootstrap,
LightClientUpdate: altair.LightClientUpdate,
LightClientFinalityUpdate: altair.LightClientFinalityUpdate,
LightClientOptimisticUpdate: altair.LightClientOptimisticUpdate,
LightClientStore: altair.LightClientStore,
},
bellatrix: {
BeaconBlock: bellatrix.BeaconBlock,
BeaconBlockBody: bellatrix.BeaconBlockBody,
LightClientHeader: altair.LightClientHeader,
LightClientBootstrap: altair.LightClientBootstrap,
LightClientUpdate: altair.LightClientUpdate,
LightClientFinalityUpdate: altair.LightClientFinalityUpdate,
LightClientOptimisticUpdate: altair.LightClientOptimisticUpdate,
LightClientStore: altair.LightClientStore,
},
capella: {
BeaconBlock: capella.BeaconBlock,
BeaconBlockBody: capella.BeaconBlockBody,
LightClientHeader: capella.LightClientHeader,
LightClientBootstrap: capella.LightClientBootstrap,
LightClientUpdate: capella.LightClientUpdate,
LightClientFinalityUpdate: capella.LightClientFinalityUpdate,
LightClientOptimisticUpdate: capella.LightClientOptimisticUpdate,
LightClientStore: capella.LightClientStore,
},
deneb: {
BeaconBlock: deneb.BeaconBlock,
BeaconBlockBody: deneb.BeaconBlockBody,
LightClientHeader: deneb.LightClientHeader,
LightClientBootstrap: deneb.LightClientBootstrap,
LightClientUpdate: deneb.LightClientUpdate,
LightClientFinalityUpdate: deneb.LightClientFinalityUpdate,
LightClientOptimisticUpdate: deneb.LightClientOptimisticUpdate,
LightClientStore: deneb.LightClientStore,
},
};

export const allForksBlobs = {
deneb: {
BlobSidecar: deneb.BlobSidecar,
BlindedBlobSidecar: deneb.BlindedBlobSidecar,
},
};
Loading

1 comment on commit 0d60dd0

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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: 0d60dd0 Previous: 64c1305 Ratio
Copy Uint8Array 100000 slice 337.72 us/op 95.202 us/op 3.55
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 325.88 us/op 93.927 us/op 3.47
Copy Buffer 100000 Uint8Array.prototype.slice.call 323.83 us/op 92.445 us/op 3.50
Copy Uint8Array 100000 subarray + set 335.35 us/op 89.652 us/op 3.74
Copy Uint8Array 100000 slice arrayBuffer 360.84 us/op 90.919 us/op 3.97
Full benchmark results
Benchmark suite Current: 0d60dd0 Previous: 64c1305 Ratio
digestTwoHashObjects 50023 times 58.854 ms/op 69.499 ms/op 0.85
digest64 50023 times 60.735 ms/op 71.653 ms/op 0.85
digest 50023 times 60.607 ms/op 71.757 ms/op 0.84
input length 32 1.4560 us/op 1.6860 us/op 0.86
input length 64 1.6070 us/op 1.8520 us/op 0.87
input length 128 2.7690 us/op 3.2770 us/op 0.84
input length 256 4.1530 us/op 4.9760 us/op 0.83
input length 512 6.7790 us/op 8.2140 us/op 0.83
input length 1024 13.566 us/op 15.901 us/op 0.85
digest 1000000 times 1.0475 s/op 1.1396 s/op 0.92
hashObjectToByteArray 50023 times 2.7317 ms/op 1.9109 ms/op 1.43
byteArrayToHashObject 50023 times 2.7794 ms/op 2.3128 ms/op 1.20
getGindicesAtDepth 6.3800 us/op 5.3000 us/op 1.20
iterateAtDepth 12.924 us/op 11.453 us/op 1.13
getGindexBits 578.00 ns/op 569.00 ns/op 1.02
gindexIterator 1.2620 us/op 1.3150 us/op 0.96
hash 2 Uint8Array 2250026 times - as-sha256 2.7744 s/op 3.2108 s/op 0.86
hashTwoObjects 2250026 times - as-sha256 2.6330 s/op 3.1039 s/op 0.85
hash 2 Uint8Array 2250026 times - noble 7.3802 s/op 8.3874 s/op 0.88
hashTwoObjects 2250026 times - noble 10.990 s/op 10.905 s/op 1.01
getNodeH() x7812.5 avg hindex 25.865 us/op 20.814 us/op 1.24
getNodeH() x7812.5 index 0 10.967 us/op 6.7780 us/op 1.62
getNodeH() x7812.5 index 7 10.916 us/op 6.7310 us/op 1.62
getNodeH() x7812.5 index 7 with key array 10.916 us/op 6.7860 us/op 1.61
new LeafNode() x7812.5 205.76 us/op 298.94 us/op 0.69
multiproof - depth 15, 1 requested leaves 14.062 us/op 15.141 us/op 0.93
tree offset multiproof - depth 15, 1 requested leaves 30.311 us/op 33.033 us/op 0.92
compact multiproof - depth 15, 1 requested leaves 8.9890 us/op 8.1840 us/op 1.10
multiproof - depth 15, 2 requested leaves 20.701 us/op 19.296 us/op 1.07
tree offset multiproof - depth 15, 2 requested leaves 36.363 us/op 34.411 us/op 1.06
compact multiproof - depth 15, 2 requested leaves 5.0130 us/op 4.6760 us/op 1.07
multiproof - depth 15, 3 requested leaves 28.600 us/op 26.456 us/op 1.08
tree offset multiproof - depth 15, 3 requested leaves 48.050 us/op 44.615 us/op 1.08
compact multiproof - depth 15, 3 requested leaves 8.8380 us/op 8.0620 us/op 1.10
multiproof - depth 15, 4 requested leaves 38.964 us/op 34.595 us/op 1.13
tree offset multiproof - depth 15, 4 requested leaves 60.504 us/op 56.815 us/op 1.06
compact multiproof - depth 15, 4 requested leaves 9.0360 us/op 9.2080 us/op 0.98
packedRootsBytesToLeafNodes bytes 4000 offset 0 3.5030 us/op 2.9710 us/op 1.18
packedRootsBytesToLeafNodes bytes 4000 offset 1 3.6960 us/op 2.8080 us/op 1.32
packedRootsBytesToLeafNodes bytes 4000 offset 2 3.6020 us/op 2.8080 us/op 1.28
packedRootsBytesToLeafNodes bytes 4000 offset 3 3.4880 us/op 2.8840 us/op 1.21
subtreeFillToContents depth 40 count 250000 75.574 ms/op 61.450 ms/op 1.23
setRoot - gindexBitstring 18.317 ms/op 12.290 ms/op 1.49
setRoot - gindex 18.043 ms/op 12.501 ms/op 1.44
getRoot - gindexBitstring 4.3758 ms/op 2.8844 ms/op 1.52
getRoot - gindex 4.8038 ms/op 4.2317 ms/op 1.14
getHashObject then setHashObject 20.034 ms/op 14.080 ms/op 1.42
setNodeWithFn 17.181 ms/op 12.571 ms/op 1.37
getNodeAtDepth depth 0 x100000 2.3717 ms/op 1.6401 ms/op 1.45
setNodeAtDepth depth 0 x100000 5.5493 ms/op 3.3378 ms/op 1.66
getNodesAtDepth depth 0 x100000 2.0954 ms/op 1.4286 ms/op 1.47
setNodesAtDepth depth 0 x100000 2.7978 ms/op 1.9973 ms/op 1.40
getNodeAtDepth depth 1 x100000 2.5242 ms/op 1.7310 ms/op 1.46
setNodeAtDepth depth 1 x100000 11.255 ms/op 7.2403 ms/op 1.55
getNodesAtDepth depth 1 x100000 2.3685 ms/op 1.5882 ms/op 1.49
setNodesAtDepth depth 1 x100000 9.1750 ms/op 6.0103 ms/op 1.53
getNodeAtDepth depth 2 x100000 3.1983 ms/op 2.1929 ms/op 1.46
setNodeAtDepth depth 2 x100000 20.470 ms/op 12.385 ms/op 1.65
getNodesAtDepth depth 2 x100000 32.082 ms/op 26.213 ms/op 1.22
setNodesAtDepth depth 2 x100000 26.741 ms/op 20.005 ms/op 1.34
tree.getNodesAtDepth - gindexes 11.222 ms/op 6.5889 ms/op 1.70
tree.getNodesAtDepth - push all nodes 3.7664 ms/op 2.2222 ms/op 1.69
tree.getNodesAtDepth - navigation 168.11 us/op 201.41 us/op 0.83
tree.setNodesAtDepth - indexes 708.96 us/op 525.49 us/op 1.35
set at depth 8 871.00 ns/op 727.00 ns/op 1.20
set at depth 16 1.1570 us/op 906.00 ns/op 1.28
set at depth 32 1.8150 us/op 1.4510 us/op 1.25
iterateNodesAtDepth 8 256 25.954 us/op 17.948 us/op 1.45
getNodesAtDepth 8 256 6.7290 us/op 4.4860 us/op 1.50
iterateNodesAtDepth 16 65536 7.3223 ms/op 5.4580 ms/op 1.34
getNodesAtDepth 16 65536 3.5054 ms/op 2.1262 ms/op 1.65
iterateNodesAtDepth 32 250000 29.904 ms/op 20.421 ms/op 1.46
getNodesAtDepth 32 250000 8.2248 ms/op 5.6279 ms/op 1.46
iterateNodesAtDepth 40 250000 26.374 ms/op 20.192 ms/op 1.31
getNodesAtDepth 40 250000 7.7910 ms/op 5.5718 ms/op 1.40
250k validators 11.935 s/op 11.078 s/op 1.08
bitlist bytes to struct (120,90) 866.00 ns/op 1.0740 us/op 0.81
bitlist bytes to tree (120,90) 4.0240 us/op 3.6700 us/op 1.10
bitlist bytes to struct (2048,2048) 1.9140 us/op 1.8120 us/op 1.06
bitlist bytes to tree (2048,2048) 6.4460 us/op 6.4930 us/op 0.99
ByteListType - deserialize 18.435 ms/op 16.319 ms/op 1.13
BasicListType - deserialize 14.362 ms/op 12.725 ms/op 1.13
ByteListType - serialize 17.715 ms/op 16.029 ms/op 1.11
BasicListType - serialize 20.932 ms/op 19.014 ms/op 1.10
BasicListType - tree_convertToStruct 32.652 ms/op 34.320 ms/op 0.95
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 6.2392 ms/op 4.3844 ms/op 1.42
List[uint8, 68719476736] len 300000 ViewDU.get(i) 6.7988 ms/op 4.4908 ms/op 1.51
Array.push len 300000 empty Array - number 8.6118 ms/op 7.9406 ms/op 1.08
Array.set len 300000 from new Array - number 2.6655 ms/op 2.0438 ms/op 1.30
Array.set len 300000 - number 8.2857 ms/op 7.6720 ms/op 1.08
Uint8Array.set len 300000 266.81 us/op 235.56 us/op 1.13
Uint32Array.set len 300000 426.34 us/op 303.50 us/op 1.40
Container({a: uint8, b: uint8}) getViewDU x300000 36.989 ms/op 28.316 ms/op 1.31
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 13.805 ms/op 12.075 ms/op 1.14
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 379.60 ms/op 477.52 ms/op 0.79
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 443.77 ms/op 452.89 ms/op 0.98
List(Container) len 300000 ViewDU.get(i) 11.832 ms/op 9.2718 ms/op 1.28
List(Container) len 300000 ViewDU.getReadonly(i) 11.363 ms/op 8.7625 ms/op 1.30
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 55.677 ms/op 50.280 ms/op 1.11
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 8.4361 ms/op 7.4576 ms/op 1.13
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 10.485 ms/op 8.9242 ms/op 1.17
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 9.9499 ms/op 8.6697 ms/op 1.15
Array.push len 300000 empty Array - object 8.4152 ms/op 7.6004 ms/op 1.11
Array.set len 300000 from new Array - object 2.8028 ms/op 2.6645 ms/op 1.05
Array.set len 300000 - object 8.7698 ms/op 7.4826 ms/op 1.17
cachePermanentRootStruct no cache 11.941 us/op 13.625 us/op 0.88
cachePermanentRootStruct with cache 302.00 ns/op 306.00 ns/op 0.99
epochParticipation len 250000 rws 7813 3.3378 ms/op 3.1182 ms/op 1.07
deserialize Attestation - tree 4.2200 us/op 4.3870 us/op 0.96
deserialize Attestation - struct 2.9620 us/op 3.0810 us/op 0.96
deserialize SignedAggregateAndProof - tree 5.4170 us/op 5.6760 us/op 0.95
deserialize SignedAggregateAndProof - struct 4.7420 us/op 4.6880 us/op 1.01
deserialize SyncCommitteeMessage - tree 1.4820 us/op 1.6640 us/op 0.89
deserialize SyncCommitteeMessage - struct 1.8550 us/op 1.8690 us/op 0.99
deserialize SignedContributionAndProof - tree 2.7920 us/op 2.9120 us/op 0.96
deserialize SignedContributionAndProof - struct 4.1220 us/op 4.0060 us/op 1.03
deserialize SignedBeaconBlock - tree 325.05 us/op 309.95 us/op 1.05
deserialize SignedBeaconBlock - struct 215.55 us/op 201.32 us/op 1.07
BeaconState vc 300000 - deserialize tree 1.0236 s/op 812.61 ms/op 1.26
BeaconState vc 300000 - serialize tree 310.79 ms/op 239.36 ms/op 1.30
BeaconState.historicalRoots vc 300000 - deserialize tree 1.2780 us/op 1.5900 us/op 0.80
BeaconState.historicalRoots vc 300000 - serialize tree 1.1770 us/op 1.5450 us/op 0.76
BeaconState.validators vc 300000 - deserialize tree 982.66 ms/op 835.20 ms/op 1.18
BeaconState.validators vc 300000 - serialize tree 274.16 ms/op 216.88 ms/op 1.26
BeaconState.balances vc 300000 - deserialize tree 37.449 ms/op 33.578 ms/op 1.12
BeaconState.balances vc 300000 - serialize tree 6.5275 ms/op 3.6316 ms/op 1.80
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 812.80 us/op 479.85 us/op 1.69
BeaconState.previousEpochParticipation vc 300000 - serialize tree 487.92 us/op 343.99 us/op 1.42
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 776.23 us/op 492.77 us/op 1.58
BeaconState.currentEpochParticipation vc 300000 - serialize tree 480.53 us/op 357.59 us/op 1.34
BeaconState.inactivityScores vc 300000 - deserialize tree 38.746 ms/op 34.205 ms/op 1.13
BeaconState.inactivityScores vc 300000 - serialize tree 6.1441 ms/op 3.6380 ms/op 1.69
hashTreeRoot Attestation - struct 38.403 us/op 41.183 us/op 0.93
hashTreeRoot Attestation - tree 25.506 us/op 28.740 us/op 0.89
hashTreeRoot SignedAggregateAndProof - struct 62.022 us/op 64.471 us/op 0.96
hashTreeRoot SignedAggregateAndProof - tree 34.437 us/op 41.266 us/op 0.83
hashTreeRoot SyncCommitteeMessage - struct 12.877 us/op 13.738 us/op 0.94
hashTreeRoot SyncCommitteeMessage - tree 7.6110 us/op 9.0440 us/op 0.84
hashTreeRoot SignedContributionAndProof - struct 36.187 us/op 38.474 us/op 0.94
hashTreeRoot SignedContributionAndProof - tree 24.838 us/op 28.712 us/op 0.87
hashTreeRoot SignedBeaconBlock - struct 3.0321 ms/op 3.4676 ms/op 0.87
hashTreeRoot SignedBeaconBlock - tree 2.0427 ms/op 2.4360 ms/op 0.84
hashTreeRoot Validator - struct 17.489 us/op 18.644 us/op 0.94
hashTreeRoot Validator - tree 14.337 us/op 15.752 us/op 0.91
BeaconState vc 300000 - hashTreeRoot tree 4.5628 s/op 5.1634 s/op 0.88
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.7590 us/op 2.1110 us/op 0.83
BeaconState.validators vc 300000 - hashTreeRoot tree 4.3048 s/op 4.9187 s/op 0.88
BeaconState.balances vc 300000 - hashTreeRoot tree 111.27 ms/op 127.32 ms/op 0.87
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 11.129 ms/op 13.215 ms/op 0.84
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 11.122 ms/op 13.165 ms/op 0.84
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 111.11 ms/op 137.09 ms/op 0.81
hash64 x18 24.860 us/op 27.846 us/op 0.89
hashTwoObjects x18 22.064 us/op 26.074 us/op 0.85
hash64 x1740 2.3176 ms/op 2.6359 ms/op 0.88
hashTwoObjects x1740 2.0948 ms/op 2.4723 ms/op 0.85
hash64 x2700000 3.6102 s/op 4.0761 s/op 0.89
hashTwoObjects x2700000 3.2600 s/op 3.8228 s/op 0.85
get_exitEpoch - ContainerType 485.00 ns/op 472.00 ns/op 1.03
get_exitEpoch - ContainerNodeStructType 401.00 ns/op 409.00 ns/op 0.98
set_exitEpoch - ContainerType 329.00 ns/op 452.00 ns/op 0.73
set_exitEpoch - ContainerNodeStructType 302.00 ns/op 417.00 ns/op 0.72
get_pubkey - ContainerType 1.5970 us/op 1.9490 us/op 0.82
get_pubkey - ContainerNodeStructType 301.00 ns/op 317.00 ns/op 0.95
hashTreeRoot - ContainerType 514.00 ns/op 510.00 ns/op 1.01
hashTreeRoot - ContainerNodeStructType 567.00 ns/op 567.00 ns/op 1.00
createProof - ContainerType 6.5370 us/op 6.7150 us/op 0.97
createProof - ContainerNodeStructType 34.813 us/op 33.282 us/op 1.05
serialize - ContainerType 2.8360 us/op 2.9550 us/op 0.96
serialize - ContainerNodeStructType 2.2870 us/op 2.4410 us/op 0.94
set_exitEpoch_and_hashTreeRoot - ContainerType 5.3090 us/op 6.0360 us/op 0.88
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 15.021 us/op 16.588 us/op 0.91
Array - for of 18.121 us/op 8.5260 us/op 2.13
Array - for(;;) 16.614 us/op 8.3900 us/op 1.98
basicListValue.readonlyValuesArray() 5.5566 ms/op 4.3744 ms/op 1.27
basicListValue.readonlyValuesArray() + loop all 5.7519 ms/op 4.4318 ms/op 1.30
compositeListValue.readonlyValuesArray() 39.266 ms/op 33.738 ms/op 1.16
compositeListValue.readonlyValuesArray() + loop all 37.952 ms/op 33.182 ms/op 1.14
Number64UintType - get balances list 6.3842 ms/op 5.6033 ms/op 1.14
Number64UintType - set balances list 15.014 ms/op 13.075 ms/op 1.15
Number64UintType - get and increase 10 then set 57.853 ms/op 50.142 ms/op 1.15
Number64UintType - increase 10 using applyDelta 25.661 ms/op 21.006 ms/op 1.22
Number64UintType - increase 10 using applyDeltaInBatch 26.017 ms/op 20.929 ms/op 1.24
tree_newTreeFromUint64Deltas 26.744 ms/op 22.073 ms/op 1.21
unsafeUint8ArrayToTree 52.044 ms/op 44.854 ms/op 1.16
bitLength(50) 313.00 ns/op 298.00 ns/op 1.05
bitLengthStr(50) 372.00 ns/op 334.00 ns/op 1.11
bitLength(8000) 304.00 ns/op 303.00 ns/op 1.00
bitLengthStr(8000) 502.00 ns/op 392.00 ns/op 1.28
bitLength(250000) 302.00 ns/op 298.00 ns/op 1.01
bitLengthStr(250000) 597.00 ns/op 453.00 ns/op 1.32
floor - Math.floor (53) 0.66978 ns/op 0.60281 ns/op 1.11
floor - << 0 (53) 0.66980 ns/op 0.60274 ns/op 1.11
floor - Math.floor (512) 0.66982 ns/op 0.60259 ns/op 1.11
floor - << 0 (512) 0.66994 ns/op 0.60268 ns/op 1.11
fnIf(0) 3.0126 ns/op 2.0086 ns/op 1.50
fnSwitch(0) 5.0197 ns/op 3.2754 ns/op 1.53
fnObj(0) 0.67002 ns/op 0.60268 ns/op 1.11
fnArr(0) 0.66969 ns/op 0.60266 ns/op 1.11
fnIf(4) 4.3508 ns/op 3.2049 ns/op 1.36
fnSwitch(4) 5.0206 ns/op 3.2889 ns/op 1.53
fnObj(4) 0.66989 ns/op 0.60262 ns/op 1.11
fnArr(4) 0.66979 ns/op 0.60282 ns/op 1.11
fnIf(9) 6.6958 ns/op 5.2297 ns/op 1.28
fnSwitch(9) 5.0227 ns/op 3.2935 ns/op 1.53
fnObj(9) 0.66979 ns/op 0.60275 ns/op 1.11
fnArr(9) 0.66976 ns/op 0.60282 ns/op 1.11
Container {a,b,vec} - as struct x100000 67.358 us/op 60.508 us/op 1.11
Container {a,b,vec} - as tree x100000 837.04 us/op 507.28 us/op 1.65
Container {a,vec,b} - as struct x100000 100.81 us/op 120.72 us/op 0.84
Container {a,vec,b} - as tree x100000 903.91 us/op 564.66 us/op 1.60
get 2 props x1000000 - rawObject 335.29 us/op 401.84 us/op 0.83
get 2 props x1000000 - proxy 144.70 ms/op 89.916 ms/op 1.61
get 2 props x1000000 - customObj 335.15 us/op 401.91 us/op 0.83
Simple object binary -> struct 863.00 ns/op 1.0670 us/op 0.81
Simple object binary -> tree_backed 2.3990 us/op 2.8520 us/op 0.84
Simple object struct -> tree_backed 3.1160 us/op 3.7660 us/op 0.83
Simple object tree_backed -> struct 2.6320 us/op 3.3000 us/op 0.80
Simple object struct -> binary 1.4040 us/op 1.7900 us/op 0.78
Simple object tree_backed -> binary 2.4000 us/op 2.7510 us/op 0.87
aggregationBits binary -> struct 760.00 ns/op 886.00 ns/op 0.86
aggregationBits binary -> tree_backed 3.1560 us/op 4.0280 us/op 0.78
aggregationBits struct -> tree_backed 4.0950 us/op 4.6870 us/op 0.87
aggregationBits tree_backed -> struct 1.6950 us/op 2.0460 us/op 0.83
aggregationBits struct -> binary 1.2260 us/op 1.4240 us/op 0.86
aggregationBits tree_backed -> binary 1.4960 us/op 1.7660 us/op 0.85
List(uint8) 100000 binary -> struct 2.0855 ms/op 1.7738 ms/op 1.18
List(uint8) 100000 binary -> tree_backed 165.94 us/op 133.39 us/op 1.24
List(uint8) 100000 struct -> tree_backed 2.5075 ms/op 1.6751 ms/op 1.50
List(uint8) 100000 tree_backed -> struct 1.6030 ms/op 1.2032 ms/op 1.33
List(uint8) 100000 struct -> binary 2.3056 ms/op 1.5640 ms/op 1.47
List(uint8) 100000 tree_backed -> binary 148.36 us/op 103.64 us/op 1.43
List(uint64Number) 100000 binary -> struct 1.9179 ms/op 1.5665 ms/op 1.22
List(uint64Number) 100000 binary -> tree_backed 5.6722 ms/op 4.7552 ms/op 1.19
List(uint64Number) 100000 struct -> tree_backed 8.7163 ms/op 5.7008 ms/op 1.53
List(uint64Number) 100000 tree_backed -> struct 3.3398 ms/op 2.6358 ms/op 1.27
List(uint64Number) 100000 struct -> binary 2.6761 ms/op 1.8739 ms/op 1.43
List(uint64Number) 100000 tree_backed -> binary 1.5922 ms/op 1.2338 ms/op 1.29
List(Uint64Bigint) 100000 binary -> struct 5.4418 ms/op 4.3725 ms/op 1.24
List(Uint64Bigint) 100000 binary -> tree_backed 5.6915 ms/op 4.8412 ms/op 1.18
List(Uint64Bigint) 100000 struct -> tree_backed 8.1273 ms/op 6.7369 ms/op 1.21
List(Uint64Bigint) 100000 tree_backed -> struct 7.2772 ms/op 5.3590 ms/op 1.36
List(Uint64Bigint) 100000 struct -> binary 3.3595 ms/op 2.5950 ms/op 1.29
List(Uint64Bigint) 100000 tree_backed -> binary 1.5219 ms/op 1.0448 ms/op 1.46
Vector(Root) 100000 binary -> struct 49.423 ms/op 47.731 ms/op 1.04
Vector(Root) 100000 binary -> tree_backed 57.417 ms/op 48.248 ms/op 1.19
Vector(Root) 100000 struct -> tree_backed 66.494 ms/op 54.740 ms/op 1.21
Vector(Root) 100000 tree_backed -> struct 74.389 ms/op 59.475 ms/op 1.25
Vector(Root) 100000 struct -> binary 3.5430 ms/op 2.5678 ms/op 1.38
Vector(Root) 100000 tree_backed -> binary 14.132 ms/op 11.534 ms/op 1.23
List(Validator) 100000 binary -> struct 192.08 ms/op 158.16 ms/op 1.21
List(Validator) 100000 binary -> tree_backed 484.24 ms/op 426.40 ms/op 1.14
List(Validator) 100000 struct -> tree_backed 551.04 ms/op 477.91 ms/op 1.15
List(Validator) 100000 tree_backed -> struct 304.94 ms/op 260.17 ms/op 1.17
List(Validator) 100000 struct -> binary 51.056 ms/op 40.901 ms/op 1.25
List(Validator) 100000 tree_backed -> binary 134.94 ms/op 111.06 ms/op 1.21
List(Validator-NS) 100000 binary -> struct 203.49 ms/op 174.09 ms/op 1.17
List(Validator-NS) 100000 binary -> tree_backed 273.58 ms/op 235.18 ms/op 1.16
List(Validator-NS) 100000 struct -> tree_backed 341.52 ms/op 287.29 ms/op 1.19
List(Validator-NS) 100000 tree_backed -> struct 284.04 ms/op 237.11 ms/op 1.20
List(Validator-NS) 100000 struct -> binary 51.636 ms/op 41.339 ms/op 1.25
List(Validator-NS) 100000 tree_backed -> binary 57.841 ms/op 47.825 ms/op 1.21
get epochStatuses - MutableVector 140.74 us/op 100.80 us/op 1.40
get epochStatuses - ViewDU 293.32 us/op 285.68 us/op 1.03
set epochStatuses - ListTreeView 2.1473 ms/op 1.8939 ms/op 1.13
set epochStatuses - ListTreeView - set() 632.31 us/op 613.89 us/op 1.03
set epochStatuses - ListTreeView - commit() 647.80 us/op 548.59 us/op 1.18
bitstring 800.75 ns/op 922.46 ns/op 0.87
bit mask 12.899 ns/op 14.492 ns/op 0.89
struct - increase slot to 1000000 2.1855 ms/op 1.8563 ms/op 1.18
UintNumberType - increase slot to 1000000 48.785 ms/op 36.270 ms/op 1.35
UintBigintType - increase slot to 1000000 643.40 ms/op 572.52 ms/op 1.12
UintBigint8 x 100000 tree_deserialize 6.8770 ms/op 5.5205 ms/op 1.25
UintBigint8 x 100000 tree_serialize 2.2653 ms/op 1.5771 ms/op 1.44
UintBigint16 x 100000 tree_deserialize 6.2761 ms/op 4.6080 ms/op 1.36
UintBigint16 x 100000 tree_serialize 2.2444 ms/op 1.5821 ms/op 1.42
UintBigint32 x 100000 tree_deserialize 8.0848 ms/op 5.1839 ms/op 1.56
UintBigint32 x 100000 tree_serialize 2.1436 ms/op 1.4706 ms/op 1.46
UintBigint64 x 100000 tree_deserialize 8.5868 ms/op 6.6783 ms/op 1.29
UintBigint64 x 100000 tree_serialize 2.9538 ms/op 1.4567 ms/op 2.03
UintBigint8 x 100000 value_deserialize 870.90 us/op 536.06 us/op 1.62
UintBigint8 x 100000 value_serialize 1.3197 ms/op 812.75 us/op 1.62
UintBigint16 x 100000 value_deserialize 932.61 us/op 583.25 us/op 1.60
UintBigint16 x 100000 value_serialize 1.3492 ms/op 850.73 us/op 1.59
UintBigint32 x 100000 value_deserialize 837.02 us/op 612.97 us/op 1.37
UintBigint32 x 100000 value_serialize 1.3810 ms/op 844.96 us/op 1.63
UintBigint64 x 100000 value_deserialize 956.74 us/op 609.70 us/op 1.57
UintBigint64 x 100000 value_serialize 1.7132 ms/op 1.0813 ms/op 1.58
UintBigint8 x 100000 deserialize 6.9238 ms/op 5.7719 ms/op 1.20
UintBigint8 x 100000 serialize 2.6356 ms/op 1.8285 ms/op 1.44
UintBigint16 x 100000 deserialize 6.8312 ms/op 5.9675 ms/op 1.14
UintBigint16 x 100000 serialize 2.6200 ms/op 1.9921 ms/op 1.32
UintBigint32 x 100000 deserialize 8.1666 ms/op 7.2285 ms/op 1.13
UintBigint32 x 100000 serialize 4.5918 ms/op 3.7742 ms/op 1.22
UintBigint64 x 100000 deserialize 5.6472 ms/op 4.4664 ms/op 1.26
UintBigint64 x 100000 serialize 2.7005 ms/op 1.8827 ms/op 1.43
UintBigint128 x 100000 deserialize 8.7612 ms/op 7.1701 ms/op 1.22
UintBigint128 x 100000 serialize 29.162 ms/op 22.003 ms/op 1.33
UintBigint256 x 100000 deserialize 16.673 ms/op 13.511 ms/op 1.23
UintBigint256 x 100000 serialize 85.641 ms/op 66.485 ms/op 1.29
Slice from Uint8Array x25000 1.7312 ms/op 1.3617 ms/op 1.27
Slice from ArrayBuffer x25000 29.661 ms/op 28.426 ms/op 1.04
Slice from ArrayBuffer x25000 + new Uint8Array 33.770 ms/op 30.921 ms/op 1.09
Copy Uint8Array 100000 iterate 1.7642 ms/op 1.1425 ms/op 1.54
Copy Uint8Array 100000 slice 337.72 us/op 95.202 us/op 3.55
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 325.88 us/op 93.927 us/op 3.47
Copy Buffer 100000 Uint8Array.prototype.slice.call 323.83 us/op 92.445 us/op 3.50
Copy Uint8Array 100000 slice + set 575.21 us/op 204.53 us/op 2.81
Copy Uint8Array 100000 subarray + set 335.35 us/op 89.652 us/op 3.74
Copy Uint8Array 100000 slice arrayBuffer 360.84 us/op 90.919 us/op 3.97
Uint64 deserialize 100000 - iterate Uint8Array 2.3371 ms/op 2.0643 ms/op 1.13
Uint64 deserialize 100000 - by Uint32A 2.1325 ms/op 1.9377 ms/op 1.10
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.1990 ms/op 1.9471 ms/op 1.13
Uint64 deserialize 100000 - by DataView.getBigUint64 7.1209 ms/op 5.8842 ms/op 1.21
Uint64 deserialize 100000 - by byte 69.241 ms/op 72.631 ms/op 0.95

Please sign in to comment.