Skip to content

Commit

Permalink
fix: Remove replaceAll with replace(/.../g,... for ES2019 compatibili…
Browse files Browse the repository at this point in the history
…ty (#309)
  • Loading branch information
g11tech authored Feb 28, 2023
1 parent 18baeaa commit 3c0a2c5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/ssz/src/util/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
export const Case = {
snake: (field: string): string =>
field
.replaceAll(/[^0-z]/g, "")
.replaceAll(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "_" + substr[1].toLowerCase()),
.replace(/[^0-z]/g, "")
.replace(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "_" + substr[1].toLowerCase()),
constant: (field: string): string =>
field
.replaceAll(/[^0-z]/g, "")
.replaceAll(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "_" + substr[1])
.replace(/[^0-z]/g, "")
.replace(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "_" + substr[1])
.toUpperCase(),
pascal: (field: string): string => {
const first = field[0].toUpperCase();
return (first + field.slice(1)).replaceAll(/[^0-z]/g, "");
return (first + field.slice(1)).replace(/[^0-z]/g, "");
},
camel: (field: string): string => {
return field[0].toLowerCase() + field.slice(1);
Expand All @@ -23,8 +23,8 @@ export const Case = {
first +
field
.slice(1)
.replaceAll(/[^0-z]/g, "")
.replaceAll(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "-" + substr[1])
.replace(/[^0-z]/g, "")
.replace(/[a-z][A-Z]|[0-9][A-Z]/g, (substr) => substr[0] + "-" + substr[1])
);
},
eth2: (field: string): string => Case.snake(field).replace(/(\d)$/, "_$1"),
Expand Down

1 comment on commit 3c0a2c5

@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: 3c0a2c5 Previous: 18baeaa Ratio
Number64UintType - get balances list 7.5013 ms/op 1.5355 ms/op 4.89
UintBigint8 x 100000 tree_serialize 2.5396 ms/op 735.62 us/op 3.45
Copy Uint8Array 100000 slice 336.82 us/op 96.837 us/op 3.48
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 334.24 us/op 99.809 us/op 3.35
Copy Buffer 100000 Uint8Array.prototype.slice.call 324.94 us/op 102.07 us/op 3.18
Copy Uint8Array 100000 slice + set 745.48 us/op 213.85 us/op 3.49
Copy Uint8Array 100000 subarray + set 345.73 us/op 98.881 us/op 3.50
Copy Uint8Array 100000 slice arrayBuffer 373.88 us/op 97.027 us/op 3.85
Full benchmark results
Benchmark suite Current: 3c0a2c5 Previous: 18baeaa Ratio
digestTwoHashObjects 50023 times 72.852 ms/op 69.159 ms/op 1.05
digest64 50023 times 75.736 ms/op 70.861 ms/op 1.07
digest 50023 times 75.768 ms/op 70.915 ms/op 1.07
input length 32 1.8730 us/op 1.7240 us/op 1.09
input length 64 2.0460 us/op 1.9080 us/op 1.07
input length 128 3.4520 us/op 3.2400 us/op 1.07
input length 256 5.2550 us/op 4.8740 us/op 1.08
input length 512 8.6680 us/op 8.0960 us/op 1.07
input length 1024 16.884 us/op 15.613 us/op 1.08
digest 1000000 times 1.2903 s/op 1.1512 s/op 1.12
hashObjectToByteArray 50023 times 2.9833 ms/op 1.9272 ms/op 1.55
byteArrayToHashObject 50023 times 3.4929 ms/op 2.0760 ms/op 1.68
getGindicesAtDepth 7.6400 us/op 5.3150 us/op 1.44
iterateAtDepth 15.687 us/op 11.012 us/op 1.42
getGindexBits 706.00 ns/op 648.00 ns/op 1.09
gindexIterator 1.5730 us/op 1.3430 us/op 1.17
hash 2 Uint8Array 2250026 times 3.4788 s/op 3.2557 s/op 1.07
hashTwoObjects 2250026 times 3.2518 s/op 3.1135 s/op 1.04
getNodeH() x7812.5 avg hindex 30.057 us/op 20.677 us/op 1.45
getNodeH() x7812.5 index 0 10.523 us/op 6.7180 us/op 1.57
getNodeH() x7812.5 index 7 10.482 us/op 6.7140 us/op 1.56
getNodeH() x7812.5 index 7 with key array 10.510 us/op 6.7380 us/op 1.56
new LeafNode() x7812.5 390.41 us/op 306.89 us/op 1.27
multiproof - depth 15, 1 requested leaves 17.332 us/op 13.837 us/op 1.25
tree offset multiproof - depth 15, 1 requested leaves 40.017 us/op 31.307 us/op 1.28
compact multiproof - depth 15, 1 requested leaves 9.1110 us/op 6.7590 us/op 1.35
multiproof - depth 15, 2 requested leaves 23.297 us/op 17.805 us/op 1.31
tree offset multiproof - depth 15, 2 requested leaves 41.844 us/op 32.826 us/op 1.27
compact multiproof - depth 15, 2 requested leaves 4.4190 us/op 3.4200 us/op 1.29
multiproof - depth 15, 3 requested leaves 32.329 us/op 24.805 us/op 1.30
tree offset multiproof - depth 15, 3 requested leaves 55.618 us/op 46.639 us/op 1.19
compact multiproof - depth 15, 3 requested leaves 8.8750 us/op 7.0820 us/op 1.25
multiproof - depth 15, 4 requested leaves 43.290 us/op 32.319 us/op 1.34
tree offset multiproof - depth 15, 4 requested leaves 69.818 us/op 54.717 us/op 1.28
compact multiproof - depth 15, 4 requested leaves 10.052 us/op 6.2350 us/op 1.61
packedRootsBytesToLeafNodes bytes 4000 offset 0 4.4950 us/op 2.8780 us/op 1.56
packedRootsBytesToLeafNodes bytes 4000 offset 1 4.3520 us/op 2.8780 us/op 1.51
packedRootsBytesToLeafNodes bytes 4000 offset 2 4.3130 us/op 2.8570 us/op 1.51
packedRootsBytesToLeafNodes bytes 4000 offset 3 4.3260 us/op 2.8420 us/op 1.52
subtreeFillToContents depth 40 count 250000 99.164 ms/op 60.764 ms/op 1.63
setRoot - gindexBitstring 16.635 ms/op 13.625 ms/op 1.22
setRoot - gindex 17.500 ms/op 15.119 ms/op 1.16
getRoot - gindexBitstring 3.7382 ms/op 2.6235 ms/op 1.42
getRoot - gindex 4.8727 ms/op 3.9678 ms/op 1.23
getHashObject then setHashObject 19.221 ms/op 16.706 ms/op 1.15
setNodeWithFn 16.663 ms/op 15.243 ms/op 1.09
getNodeAtDepth depth 0 x100000 2.8425 ms/op 1.6045 ms/op 1.77
setNodeAtDepth depth 0 x100000 5.1198 ms/op 3.9992 ms/op 1.28
getNodesAtDepth depth 0 x100000 2.4192 ms/op 1.4047 ms/op 1.72
setNodesAtDepth depth 0 x100000 3.0474 ms/op 1.9755 ms/op 1.54
getNodeAtDepth depth 1 x100000 2.7221 ms/op 1.7335 ms/op 1.57
setNodeAtDepth depth 1 x100000 11.592 ms/op 12.090 ms/op 0.96
getNodesAtDepth depth 1 x100000 2.5486 ms/op 1.5817 ms/op 1.61
setNodesAtDepth depth 1 x100000 9.5297 ms/op 8.7325 ms/op 1.09
getNodeAtDepth depth 2 x100000 3.5005 ms/op 2.1980 ms/op 1.59
setNodeAtDepth depth 2 x100000 19.015 ms/op 18.468 ms/op 1.03
getNodesAtDepth depth 2 x100000 34.460 ms/op 28.452 ms/op 1.21
setNodesAtDepth depth 2 x100000 25.447 ms/op 26.091 ms/op 0.98
tree.getNodesAtDepth - gindexes 10.631 ms/op 9.9726 ms/op 1.07
tree.getNodesAtDepth - push all nodes 3.3726 ms/op 4.1589 ms/op 0.81
tree.getNodesAtDepth - navigation 211.64 us/op 201.48 us/op 1.05
tree.setNodesAtDepth - indexes 717.18 us/op 703.29 us/op 1.02
set at depth 8 955.00 ns/op 1.0170 us/op 0.94
set at depth 16 1.0650 us/op 1.3620 us/op 0.78
set at depth 32 2.1030 us/op 2.1970 us/op 0.96
iterateNodesAtDepth 8 256 29.725 us/op 20.712 us/op 1.44
getNodesAtDepth 8 256 7.3810 us/op 4.8870 us/op 1.51
iterateNodesAtDepth 16 65536 8.3344 ms/op 5.6495 ms/op 1.48
getNodesAtDepth 16 65536 3.1090 ms/op 2.9089 ms/op 1.07
iterateNodesAtDepth 32 250000 30.865 ms/op 22.730 ms/op 1.36
getNodesAtDepth 32 250000 8.8798 ms/op 5.7671 ms/op 1.54
iterateNodesAtDepth 40 250000 30.674 ms/op 20.169 ms/op 1.52
getNodesAtDepth 40 250000 8.8041 ms/op 6.0113 ms/op 1.46
250k validators 3.7475 s/op 3.4289 s/op 1.09
bitlist bytes to struct (120,90) 1.6140 us/op 1.2490 us/op 1.29
bitlist bytes to tree (120,90) 6.2340 us/op 4.7610 us/op 1.31
bitlist bytes to struct (2048,2048) 2.6350 us/op 1.9500 us/op 1.35
bitlist bytes to tree (2048,2048) 10.248 us/op 7.9120 us/op 1.30
ByteListType - deserialize 22.487 ms/op 16.771 ms/op 1.34
BasicListType - deserialize 35.615 ms/op 43.256 ms/op 0.82
ByteListType - serialize 21.833 ms/op 16.001 ms/op 1.36
BasicListType - serialize 26.234 ms/op 16.897 ms/op 1.55
BasicListType - tree_convertToStruct 63.267 ms/op 37.189 ms/op 1.70
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 7.3847 ms/op 4.6815 ms/op 1.58
List[uint8, 68719476736] len 300000 ViewDU.get(i) 7.8946 ms/op 4.4940 ms/op 1.76
Array.push len 300000 empty Array - number 10.073 ms/op 7.4778 ms/op 1.35
Array.set len 300000 from new Array - number 3.3252 ms/op 2.2798 ms/op 1.46
Array.set len 300000 - number 9.9056 ms/op 7.4169 ms/op 1.34
Uint8Array.set len 300000 328.73 us/op 239.83 us/op 1.37
Uint32Array.set len 300000 511.76 us/op 314.31 us/op 1.63
Container({a: uint8, b: uint8}) getViewDU x300000 43.660 ms/op 29.645 ms/op 1.47
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 16.713 ms/op 12.265 ms/op 1.36
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 460.28 ms/op 335.12 ms/op 1.37
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 579.05 ms/op 405.25 ms/op 1.43
List(Container) len 300000 ViewDU.get(i) 13.153 ms/op 9.9842 ms/op 1.32
List(Container) len 300000 ViewDU.getReadonly(i) 12.887 ms/op 8.7569 ms/op 1.47
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 70.375 ms/op 39.963 ms/op 1.76
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 9.5393 ms/op 7.8769 ms/op 1.21
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 12.651 ms/op 8.7347 ms/op 1.45
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 12.150 ms/op 8.7362 ms/op 1.39
Array.push len 300000 empty Array - object 9.9249 ms/op 7.8738 ms/op 1.26
Array.set len 300000 from new Array - object 3.4244 ms/op 2.6984 ms/op 1.27
Array.set len 300000 - object 9.8294 ms/op 7.9068 ms/op 1.24
cachePermanentRootStruct no cache 15.297 us/op 13.495 us/op 1.13
cachePermanentRootStruct with cache 361.00 ns/op 389.00 ns/op 0.93
epochParticipation len 250000 rws 7813 3.9360 ms/op 3.1187 ms/op 1.26
deserialize Attestation - tree 5.2190 us/op 4.4560 us/op 1.17
deserialize Attestation - struct 3.6130 us/op 3.1310 us/op 1.15
deserialize SignedAggregateAndProof - tree 6.7850 us/op 5.6360 us/op 1.20
deserialize SignedAggregateAndProof - struct 5.7720 us/op 4.7410 us/op 1.22
deserialize SyncCommitteeMessage - tree 1.9920 us/op 1.6940 us/op 1.18
deserialize SyncCommitteeMessage - struct 2.2470 us/op 1.9630 us/op 1.14
deserialize SignedContributionAndProof - tree 3.5710 us/op 2.8260 us/op 1.26
deserialize SignedContributionAndProof - struct 4.9610 us/op 4.1570 us/op 1.19
deserialize SignedBeaconBlock - tree 387.07 us/op 319.51 us/op 1.21
deserialize SignedBeaconBlock - struct 248.84 us/op 211.02 us/op 1.18
BeaconState vc 300000 - deserialize tree 1.2297 s/op 815.86 ms/op 1.51
BeaconState vc 300000 - serialize tree 327.40 ms/op 255.62 ms/op 1.28
BeaconState.historicalRoots vc 300000 - deserialize tree 1.3260 us/op 1.2410 us/op 1.07
BeaconState.historicalRoots vc 300000 - serialize tree 1.5510 us/op 1.3990 us/op 1.11
BeaconState.validators vc 300000 - deserialize tree 1.1594 s/op 849.16 ms/op 1.37
BeaconState.validators vc 300000 - serialize tree 285.49 ms/op 189.61 ms/op 1.51
BeaconState.balances vc 300000 - deserialize tree 44.698 ms/op 35.097 ms/op 1.27
BeaconState.balances vc 300000 - serialize tree 6.6970 ms/op 3.4499 ms/op 1.94
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 810.34 us/op 487.44 us/op 1.66
BeaconState.previousEpochParticipation vc 300000 - serialize tree 558.64 us/op 342.15 us/op 1.63
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 813.97 us/op 488.96 us/op 1.66
BeaconState.currentEpochParticipation vc 300000 - serialize tree 554.73 us/op 337.85 us/op 1.64
BeaconState.inactivityScores vc 300000 - deserialize tree 46.190 ms/op 30.894 ms/op 1.50
BeaconState.inactivityScores vc 300000 - serialize tree 6.9525 ms/op 4.1034 ms/op 1.69
hashTreeRoot Attestation - struct 53.402 us/op 45.810 us/op 1.17
hashTreeRoot Attestation - tree 36.408 us/op 31.807 us/op 1.14
hashTreeRoot SignedAggregateAndProof - struct 75.965 us/op 73.119 us/op 1.04
hashTreeRoot SignedAggregateAndProof - tree 47.220 us/op 43.775 us/op 1.08
hashTreeRoot SyncCommitteeMessage - struct 17.135 us/op 15.075 us/op 1.14
hashTreeRoot SyncCommitteeMessage - tree 10.288 us/op 9.5080 us/op 1.08
hashTreeRoot SignedContributionAndProof - struct 47.739 us/op 41.857 us/op 1.14
hashTreeRoot SignedContributionAndProof - tree 35.121 us/op 31.337 us/op 1.12
hashTreeRoot SignedBeaconBlock - struct 4.2475 ms/op 3.6396 ms/op 1.17
hashTreeRoot SignedBeaconBlock - tree 2.7463 ms/op 2.5729 ms/op 1.07
hashTreeRoot Validator - struct 22.516 us/op 18.882 us/op 1.19
hashTreeRoot Validator - tree 18.953 us/op 16.425 us/op 1.15
BeaconState vc 300000 - hashTreeRoot tree 6.0248 s/op 5.3147 s/op 1.13
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 2.3430 us/op 2.2040 us/op 1.06
BeaconState.validators vc 300000 - hashTreeRoot tree 5.7220 s/op 5.0961 s/op 1.12
BeaconState.balances vc 300000 - hashTreeRoot tree 138.28 ms/op 130.00 ms/op 1.06
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 15.072 ms/op 13.816 ms/op 1.09
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 14.990 ms/op 13.819 ms/op 1.08
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 138.61 ms/op 137.91 ms/op 1.01
hash64 x18 30.257 us/op 28.250 us/op 1.07
hashTwoObjects x18 29.637 us/op 27.629 us/op 1.07
hash64 x1740 2.8951 ms/op 2.6602 ms/op 1.09
hashTwoObjects x1740 2.8199 ms/op 2.5802 ms/op 1.09
hash64 x2700000 4.4560 s/op 4.1103 s/op 1.08
hashTwoObjects x2700000 4.3548 s/op 4.0532 s/op 1.07
get_exitEpoch - ContainerType 620.00 ns/op 563.00 ns/op 1.10
get_exitEpoch - ContainerNodeStructType 515.00 ns/op 503.00 ns/op 1.02
set_exitEpoch - ContainerType 550.00 ns/op 533.00 ns/op 1.03
set_exitEpoch - ContainerNodeStructType 510.00 ns/op 490.00 ns/op 1.04
get_pubkey - ContainerType 2.2090 us/op 1.7190 us/op 1.29
get_pubkey - ContainerNodeStructType 379.00 ns/op 380.00 ns/op 1.00
hashTreeRoot - ContainerType 621.00 ns/op 562.00 ns/op 1.10
hashTreeRoot - ContainerNodeStructType 703.00 ns/op 652.00 ns/op 1.08
createProof - ContainerType 8.0530 us/op 6.7860 us/op 1.19
createProof - ContainerNodeStructType 42.681 us/op 33.722 us/op 1.27
serialize - ContainerType 3.7250 us/op 3.0980 us/op 1.20
serialize - ContainerNodeStructType 2.7810 us/op 2.4220 us/op 1.15
set_exitEpoch_and_hashTreeRoot - ContainerType 6.9740 us/op 6.3750 us/op 1.09
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 19.838 us/op 17.293 us/op 1.15
Array - for of 13.187 us/op 6.7540 us/op 1.95
Array - for(;;) 8.9890 us/op 6.6290 us/op 1.36
basicListValue.readonlyValuesArray() 6.3671 ms/op 4.2756 ms/op 1.49
basicListValue.readonlyValuesArray() + loop all 6.5359 ms/op 4.4082 ms/op 1.48
compositeListValue.readonlyValuesArray() 62.369 ms/op 33.938 ms/op 1.84
compositeListValue.readonlyValuesArray() + loop all 48.885 ms/op 32.080 ms/op 1.52
Number64UintType - get balances list 7.5013 ms/op 1.5355 ms/op 4.89
Number64UintType - set balances list 20.158 ms/op 14.124 ms/op 1.43
Number64UintType - get and increase 10 then set 71.069 ms/op 45.445 ms/op 1.56
Number64UintType - increase 10 using applyDelta 31.709 ms/op 17.594 ms/op 1.80
Number64UintType - increase 10 using applyDeltaInBatch 31.651 ms/op 17.427 ms/op 1.82
tree_newTreeFromUint64Deltas 32.400 ms/op 22.914 ms/op 1.41
unsafeUint8ArrayToTree 55.881 ms/op 39.998 ms/op 1.40
bitLength(50) 381.00 ns/op 338.00 ns/op 1.13
bitLengthStr(50) 432.00 ns/op 373.00 ns/op 1.16
bitLength(8000) 363.00 ns/op 328.00 ns/op 1.11
bitLengthStr(8000) 601.00 ns/op 418.00 ns/op 1.44
bitLength(250000) 365.00 ns/op 331.00 ns/op 1.10
bitLengthStr(250000) 719.00 ns/op 487.00 ns/op 1.48
floor - Math.floor (53) 0.83723 ns/op 0.60275 ns/op 1.39
floor - << 0 (53) 0.83807 ns/op 0.60274 ns/op 1.39
floor - Math.floor (512) 0.83731 ns/op 0.60294 ns/op 1.39
floor - << 0 (512) 0.83728 ns/op 0.60265 ns/op 1.39
fnIf(0) 3.3487 ns/op 2.0082 ns/op 1.67
fnSwitch(0) 6.2776 ns/op 3.3171 ns/op 1.89
fnObj(0) 0.83740 ns/op 0.60278 ns/op 1.39
fnArr(0) 0.83734 ns/op 0.60272 ns/op 1.39
fnIf(4) 5.4411 ns/op 3.1969 ns/op 1.70
fnSwitch(4) 6.2760 ns/op 3.2873 ns/op 1.91
fnObj(4) 0.83732 ns/op 0.60263 ns/op 1.39
fnArr(4) 0.83739 ns/op 0.60281 ns/op 1.39
fnIf(9) 8.3681 ns/op 5.2272 ns/op 1.60
fnSwitch(9) 6.2763 ns/op 3.2847 ns/op 1.91
fnObj(9) 0.83727 ns/op 0.60266 ns/op 1.39
fnArr(9) 0.83733 ns/op 0.60273 ns/op 1.39
Container {a,b,vec} - as struct x100000 84.183 us/op 60.533 us/op 1.39
Container {a,b,vec} - as tree x100000 1.0465 ms/op 522.38 us/op 2.00
Container {a,vec,b} - as struct x100000 126.01 us/op 120.76 us/op 1.04
Container {a,vec,b} - as tree x100000 1.1302 ms/op 550.00 us/op 2.05
get 2 props x1000000 - rawObject 419.43 us/op 401.90 us/op 1.04
get 2 props x1000000 - proxy 166.70 ms/op 90.592 ms/op 1.84
get 2 props x1000000 - customObj 418.86 us/op 401.95 us/op 1.04
Simple object binary -> struct 1.0400 us/op 952.00 ns/op 1.09
Simple object binary -> tree_backed 2.9150 us/op 2.5330 us/op 1.15
Simple object struct -> tree_backed 3.7500 us/op 3.2020 us/op 1.17
Simple object tree_backed -> struct 3.2120 us/op 2.7880 us/op 1.15
Simple object struct -> binary 1.7440 us/op 1.3950 us/op 1.25
Simple object tree_backed -> binary 2.8240 us/op 2.4110 us/op 1.17
aggregationBits binary -> struct 861.00 ns/op 810.00 ns/op 1.06
aggregationBits binary -> tree_backed 3.7270 us/op 3.1770 us/op 1.17
aggregationBits struct -> tree_backed 4.5580 us/op 3.8750 us/op 1.18
aggregationBits tree_backed -> struct 1.8900 us/op 1.6540 us/op 1.14
aggregationBits struct -> binary 1.3690 us/op 1.1730 us/op 1.17
aggregationBits tree_backed -> binary 1.7860 us/op 1.6490 us/op 1.08
List(uint8) 100000 binary -> struct 2.1689 ms/op 1.8344 ms/op 1.18
List(uint8) 100000 binary -> tree_backed 181.47 us/op 158.44 us/op 1.15
List(uint8) 100000 struct -> tree_backed 2.6217 ms/op 1.8430 ms/op 1.42
List(uint8) 100000 tree_backed -> struct 1.8217 ms/op 1.2437 ms/op 1.46
List(uint8) 100000 struct -> binary 2.4103 ms/op 1.6188 ms/op 1.49
List(uint8) 100000 tree_backed -> binary 175.72 us/op 96.113 us/op 1.83
List(uint64Number) 100000 binary -> struct 2.0455 ms/op 1.5824 ms/op 1.29
List(uint64Number) 100000 binary -> tree_backed 6.1877 ms/op 5.2410 ms/op 1.18
List(uint64Number) 100000 struct -> tree_backed 9.4200 ms/op 7.1244 ms/op 1.32
List(uint64Number) 100000 tree_backed -> struct 3.7107 ms/op 2.7433 ms/op 1.35
List(uint64Number) 100000 struct -> binary 2.6959 ms/op 1.9942 ms/op 1.35
List(uint64Number) 100000 tree_backed -> binary 1.8323 ms/op 1.1694 ms/op 1.57
List(Uint64Bigint) 100000 binary -> struct 6.4501 ms/op 4.3238 ms/op 1.49
List(Uint64Bigint) 100000 binary -> tree_backed 6.2413 ms/op 4.9340 ms/op 1.26
List(Uint64Bigint) 100000 struct -> tree_backed 10.301 ms/op 7.3971 ms/op 1.39
List(Uint64Bigint) 100000 tree_backed -> struct 8.3680 ms/op 5.9088 ms/op 1.42
List(Uint64Bigint) 100000 struct -> binary 3.6524 ms/op 2.6222 ms/op 1.39
List(Uint64Bigint) 100000 tree_backed -> binary 1.8250 ms/op 1.1397 ms/op 1.60
Vector(Root) 100000 binary -> struct 56.678 ms/op 39.335 ms/op 1.44
Vector(Root) 100000 binary -> tree_backed 64.865 ms/op 47.326 ms/op 1.37
Vector(Root) 100000 struct -> tree_backed 73.565 ms/op 53.988 ms/op 1.36
Vector(Root) 100000 tree_backed -> struct 85.103 ms/op 62.382 ms/op 1.36
Vector(Root) 100000 struct -> binary 3.9367 ms/op 2.5898 ms/op 1.52
Vector(Root) 100000 tree_backed -> binary 16.521 ms/op 11.642 ms/op 1.42
List(Validator) 100000 binary -> struct 243.37 ms/op 171.72 ms/op 1.42
List(Validator) 100000 binary -> tree_backed 562.44 ms/op 435.20 ms/op 1.29
List(Validator) 100000 struct -> tree_backed 631.70 ms/op 469.47 ms/op 1.35
List(Validator) 100000 tree_backed -> struct 365.53 ms/op 251.51 ms/op 1.45
List(Validator) 100000 struct -> binary 57.270 ms/op 40.779 ms/op 1.40
List(Validator) 100000 tree_backed -> binary 166.85 ms/op 110.01 ms/op 1.52
List(Validator-NS) 100000 binary -> struct 239.70 ms/op 168.66 ms/op 1.42
List(Validator-NS) 100000 binary -> tree_backed 313.56 ms/op 233.00 ms/op 1.35
List(Validator-NS) 100000 struct -> tree_backed 390.42 ms/op 283.80 ms/op 1.38
List(Validator-NS) 100000 tree_backed -> struct 331.17 ms/op 235.73 ms/op 1.40
List(Validator-NS) 100000 struct -> binary 57.550 ms/op 41.290 ms/op 1.39
List(Validator-NS) 100000 tree_backed -> binary 66.800 ms/op 47.611 ms/op 1.40
get epochStatuses - MutableVector 148.47 us/op 104.06 us/op 1.43
get epochStatuses - ViewDU 367.22 us/op 239.41 us/op 1.53
set epochStatuses - ListTreeView 2.6642 ms/op 1.8985 ms/op 1.40
set epochStatuses - ListTreeView - set() 762.13 us/op 625.68 us/op 1.22
set epochStatuses - ListTreeView - commit() 808.38 us/op 553.59 us/op 1.46
bitstring 963.66 ns/op 927.91 ns/op 1.04
bit mask 16.089 ns/op 14.496 ns/op 1.11
struct - increase slot to 1000000 2.7324 ms/op 1.8106 ms/op 1.51
UintNumberType - increase slot to 1000000 60.845 ms/op 36.945 ms/op 1.65
UintBigintType - increase slot to 1000000 772.86 ms/op 566.47 ms/op 1.36
UintBigint8 x 100000 tree_deserialize 7.4969 ms/op 5.1494 ms/op 1.46
UintBigint8 x 100000 tree_serialize 2.5396 ms/op 735.62 us/op 3.45
UintBigint16 x 100000 tree_deserialize 6.9924 ms/op 4.8182 ms/op 1.45
UintBigint16 x 100000 tree_serialize 2.6611 ms/op 1.5756 ms/op 1.69
UintBigint32 x 100000 tree_deserialize 9.0186 ms/op 6.6967 ms/op 1.35
UintBigint32 x 100000 tree_serialize 2.3886 ms/op 1.7506 ms/op 1.36
UintBigint64 x 100000 tree_deserialize 9.9663 ms/op 7.0975 ms/op 1.40
UintBigint64 x 100000 tree_serialize 3.1703 ms/op 2.2681 ms/op 1.40
UintBigint8 x 100000 value_deserialize 1.0883 ms/op 544.53 us/op 2.00
UintBigint8 x 100000 value_serialize 1.4264 ms/op 925.52 us/op 1.54
UintBigint16 x 100000 value_deserialize 1.1622 ms/op 576.93 us/op 2.01
UintBigint16 x 100000 value_serialize 1.5395 ms/op 1.0064 ms/op 1.53
UintBigint32 x 100000 value_deserialize 1.0535 ms/op 546.45 us/op 1.93
UintBigint32 x 100000 value_serialize 1.5543 ms/op 993.07 us/op 1.57
UintBigint64 x 100000 value_deserialize 1.1445 ms/op 630.89 us/op 1.81
UintBigint64 x 100000 value_serialize 1.8046 ms/op 1.2442 ms/op 1.45
UintBigint8 x 100000 deserialize 8.5592 ms/op 6.2300 ms/op 1.37
UintBigint8 x 100000 serialize 3.1415 ms/op 1.9317 ms/op 1.63
UintBigint16 x 100000 deserialize 8.5234 ms/op 5.8656 ms/op 1.45
UintBigint16 x 100000 serialize 3.3353 ms/op 2.0571 ms/op 1.62
UintBigint32 x 100000 deserialize 10.149 ms/op 7.1049 ms/op 1.43
UintBigint32 x 100000 serialize 5.4356 ms/op 3.6221 ms/op 1.50
UintBigint64 x 100000 deserialize 6.5412 ms/op 4.4801 ms/op 1.46
UintBigint64 x 100000 serialize 3.0593 ms/op 1.9085 ms/op 1.60
UintBigint128 x 100000 deserialize 10.387 ms/op 7.0560 ms/op 1.47
UintBigint128 x 100000 serialize 34.033 ms/op 21.695 ms/op 1.57
UintBigint256 x 100000 deserialize 19.520 ms/op 13.118 ms/op 1.49
UintBigint256 x 100000 serialize 102.93 ms/op 63.952 ms/op 1.61
Slice from Uint8Array x25000 1.8743 ms/op 1.3232 ms/op 1.42
Slice from ArrayBuffer x25000 32.735 ms/op 25.687 ms/op 1.27
Slice from ArrayBuffer x25000 + new Uint8Array 36.220 ms/op 27.199 ms/op 1.33
Copy Uint8Array 100000 iterate 1.8291 ms/op 1.0536 ms/op 1.74
Copy Uint8Array 100000 slice 336.82 us/op 96.837 us/op 3.48
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 334.24 us/op 99.809 us/op 3.35
Copy Buffer 100000 Uint8Array.prototype.slice.call 324.94 us/op 102.07 us/op 3.18
Copy Uint8Array 100000 slice + set 745.48 us/op 213.85 us/op 3.49
Copy Uint8Array 100000 subarray + set 345.73 us/op 98.881 us/op 3.50
Copy Uint8Array 100000 slice arrayBuffer 373.88 us/op 97.027 us/op 3.85
Uint64 deserialize 100000 - iterate Uint8Array 2.6756 ms/op 2.0892 ms/op 1.28
Uint64 deserialize 100000 - by Uint32A 2.4136 ms/op 1.9825 ms/op 1.22
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.5532 ms/op 2.0265 ms/op 1.26
Uint64 deserialize 100000 - by DataView.getBigUint64 8.1417 ms/op 5.8826 ms/op 1.38
Uint64 deserialize 100000 - by byte 86.263 ms/op 72.216 ms/op 1.19

Please sign in to comment.