Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tests workflow for bun and deno #423

Merged
merged 19 commits into from
Feb 27, 2025
Merged

Conversation

nazarhussain
Copy link
Contributor

@nazarhussain nazarhussain commented Nov 21, 2024

Motivation

Make the packages compatible with Deno+Bun.

Description

  • Make unit tests compatible with Deno+Bun
  • Make spec tests compatible with Deno+Bun

Steps to test or reproduce

  • Run all tests

@nazarhussain nazarhussain changed the title Add tests workflow for deno chore: add tests workflow for deno Nov 21, 2024
@nazarhussain nazarhussain changed the title chore: add tests workflow for deno feat: add tests workflow for deno Nov 21, 2024
@nazarhussain nazarhussain marked this pull request as ready for review November 21, 2024 13:54
@nazarhussain nazarhussain requested a review from a team as a code owner November 21, 2024 13:54
@nazarhussain nazarhussain self-assigned this Nov 22, 2024
@twoeths
Copy link
Contributor

twoeths commented Nov 25, 2024

while I see the improvement on the source code, like not to import lib from other modules, I don't see why do we have to pick Deno and make sure lodestar to be compliant to it? there are a lot of deno specific resources added in this PR

I guess we need to put this on hold until we have final approach on which javascript runtime that lodestar want to experiment ChainSafe/lodestar#7237

@nazarhussain
Copy link
Contributor Author

nazarhussain commented Nov 25, 2024

while I see the improvement on the source code, like not to import lib from other modules, I don't see why do we have to pick Deno and make sure lodestar to be compliant to it? there are a lot of deno specific resources added in this PR

Deno is needed/recommended to publish packages to jsr.io which is intention to test with deno first in this PR.

And here is the details that why I am moving to support jsr.io https://jsr.io/docs/why

@twoeths
Copy link
Contributor

twoeths commented Nov 26, 2024

Does Bun support jsr.io?

if yes I'd go with Bun as we'll most likely to go with it. Again, need to wait for the final decision on ChainSafe/lodestar#7237

if both NodeJS + Bun don't support jsr.io, only Deno does then we need to see if it's a must to support jsr.io. I found it weird to target Bun/NodeJS while having Deno specific resources in the repo

@nazarhussain
Copy link
Contributor Author

Does Bun support jsr.io?

jsr.io is a registry developed and maintained by Bun for typescript based packages. As it follow modern standards it's compatible with all runtimes. As it's mentioned on there website.

JSR modules can be used in Node.js, Deno, Bun, Cloudflare Workers, and more.

@nazarhussain nazarhussain changed the title feat: add tests workflow for deno feat: add tests workflow for bun and deno Dec 17, 2024
@nazarhussain nazarhussain changed the base branch from feature/deno to master January 17, 2025 15:59
@nazarhussain nazarhussain changed the base branch from master to feature/deno January 17, 2025 15:59
@nazarhussain nazarhussain changed the base branch from feature/deno to master January 17, 2025 16:11
Copy link

github-actions bot commented Jan 17, 2025

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 78480c9 Previous: 5041139 Ratio
digestTwoHashObjects 50023 times 48.471 ms/op 48.248 ms/op 1.00
digest2Bytes32 50023 times 54.579 ms/op 54.794 ms/op 1.00
digest 50023 times 53.799 ms/op 53.430 ms/op 1.01
input length 32 1.1830 us/op 1.1670 us/op 1.01
input length 64 1.3220 us/op 1.3180 us/op 1.00
input length 128 2.2470 us/op 2.2320 us/op 1.01
input length 256 3.3430 us/op 3.3300 us/op 1.00
input length 512 5.5510 us/op 5.5630 us/op 1.00
input length 1024 10.723 us/op 10.681 us/op 1.00
digest 1000000 times 863.52 ms/op 852.84 ms/op 1.01
hashObjectToByteArray 50023 times 1.2308 ms/op 1.2289 ms/op 1.00
byteArrayToHashObject 50023 times 1.5477 ms/op 1.5426 ms/op 1.00
digest64 200092 times 214.75 ms/op 214.18 ms/op 1.00
hash 200092 times using batchHash4UintArray64s 238.32 ms/op 250.07 ms/op 0.95
digest64HashObjects 200092 times 192.40 ms/op 191.43 ms/op 1.01
hash 200092 times using batchHash4HashObjectInputs 198.77 ms/op 197.77 ms/op 1.01
getGindicesAtDepth 3.4440 us/op 3.4480 us/op 1.00
iterateAtDepth 6.3000 us/op 6.3750 us/op 0.99
getGindexBits 366.00 ns/op 356.00 ns/op 1.03
gindexIterator 827.00 ns/op 896.00 ns/op 0.92
HashComputationLevel.push then loop 26.152 ms/op 25.761 ms/op 1.02
HashComputation[] push then loop 46.627 ms/op 47.920 ms/op 0.97
hash 2 Uint8Array 500000 times - hashtree 219.91 ms/op 213.19 ms/op 1.03
hashTwoObjects 500000 times - hashtree 212.45 ms/op 214.65 ms/op 0.99
executeHashComputations - hashtree 10.037 ms/op 9.4258 ms/op 1.06
hash 2 Uint8Array 500000 times - as-sha256 563.18 ms/op 560.79 ms/op 1.00
hashTwoObjects 500000 times - as-sha256 512.39 ms/op 509.59 ms/op 1.01
executeHashComputations - as-sha256 47.079 ms/op 44.935 ms/op 1.05
hash 2 Uint8Array 500000 times - noble 1.2493 s/op 1.2219 s/op 1.02
hashTwoObjects 500000 times - noble 1.6977 s/op 1.6307 s/op 1.04
executeHashComputations - noble 36.756 ms/op 36.118 ms/op 1.02
getHashComputations 2.1085 ms/op 2.0905 ms/op 1.01
executeHashComputations 10.257 ms/op 10.248 ms/op 1.00
get root 15.496 ms/op 15.171 ms/op 1.02
getNodeH() x7812.5 avg hindex 12.209 us/op 12.186 us/op 1.00
getNodeH() x7812.5 index 0 7.4990 us/op 7.5320 us/op 1.00
getNodeH() x7812.5 index 7 7.5280 us/op 7.4730 us/op 1.01
getNodeH() x7812.5 index 7 with key array 6.2660 us/op 6.2860 us/op 1.00
new LeafNode() x7812.5 291.64 us/op 298.94 us/op 0.98
getHashComputations 250000 nodes 14.964 ms/op 14.464 ms/op 1.03
batchHash 250000 nodes 90.272 ms/op 85.554 ms/op 1.06
get root 250000 nodes 121.14 ms/op 115.63 ms/op 1.05
getHashComputations 500000 nodes 42.120 ms/op 33.095 ms/op 1.27
batchHash 500000 nodes 166.51 ms/op 165.80 ms/op 1.00
get root 500000 nodes 242.13 ms/op 230.95 ms/op 1.05
getHashComputations 1000000 nodes 79.720 ms/op 61.868 ms/op 1.29
batchHash 1000000 nodes 321.00 ms/op 360.79 ms/op 0.89
get root 1000000 nodes 465.74 ms/op 468.00 ms/op 1.00
multiproof - depth 15, 1 requested leaves 8.1080 us/op 8.0560 us/op 1.01
tree offset multiproof - depth 15, 1 requested leaves 18.088 us/op 17.674 us/op 1.02
compact multiproof - depth 15, 1 requested leaves 3.0830 us/op 2.9060 us/op 1.06
multiproof - depth 15, 2 requested leaves 11.303 us/op 11.648 us/op 0.97
tree offset multiproof - depth 15, 2 requested leaves 21.330 us/op 21.182 us/op 1.01
compact multiproof - depth 15, 2 requested leaves 3.1050 us/op 2.9630 us/op 1.05
multiproof - depth 15, 3 requested leaves 15.909 us/op 16.292 us/op 0.98
tree offset multiproof - depth 15, 3 requested leaves 27.165 us/op 27.060 us/op 1.00
compact multiproof - depth 15, 3 requested leaves 3.7300 us/op 3.5790 us/op 1.04
multiproof - depth 15, 4 requested leaves 21.015 us/op 21.682 us/op 0.97
tree offset multiproof - depth 15, 4 requested leaves 33.705 us/op 33.787 us/op 1.00
compact multiproof - depth 15, 4 requested leaves 4.3380 us/op 4.1570 us/op 1.04
packedRootsBytesToLeafNodes bytes 4000 offset 0 5.6300 us/op 5.5150 us/op 1.02
packedRootsBytesToLeafNodes bytes 4000 offset 1 5.6710 us/op 5.4370 us/op 1.04
packedRootsBytesToLeafNodes bytes 4000 offset 2 5.6170 us/op 5.4920 us/op 1.02
packedRootsBytesToLeafNodes bytes 4000 offset 3 5.6760 us/op 5.4890 us/op 1.03
subtreeFillToContents depth 40 count 250000 56.632 ms/op 46.753 ms/op 1.21
setRoot - gindexBitstring 19.427 ms/op 21.228 ms/op 0.92
setRoot - gindex 20.150 ms/op 22.040 ms/op 0.91
getRoot - gindexBitstring 2.4404 ms/op 2.5335 ms/op 0.96
getRoot - gindex 2.9683 ms/op 3.1068 ms/op 0.96
getHashObject then setHashObject 20.666 ms/op 22.187 ms/op 0.93
setNodeWithFn 18.193 ms/op 19.955 ms/op 0.91
getNodeAtDepth depth 0 x100000 280.21 us/op 282.81 us/op 0.99
setNodeAtDepth depth 0 x100000 2.2369 ms/op 2.6916 ms/op 0.83
getNodesAtDepth depth 0 x100000 311.95 us/op 315.41 us/op 0.99
setNodesAtDepth depth 0 x100000 775.24 us/op 791.01 us/op 0.98
getNodeAtDepth depth 1 x100000 343.17 us/op 343.13 us/op 1.00
setNodeAtDepth depth 1 x100000 7.3664 ms/op 8.5334 ms/op 0.86
getNodesAtDepth depth 1 x100000 438.21 us/op 440.75 us/op 0.99
setNodesAtDepth depth 1 x100000 6.2171 ms/op 6.8871 ms/op 0.90
getNodeAtDepth depth 2 x100000 738.83 us/op 740.07 us/op 1.00
setNodeAtDepth depth 2 x100000 14.278 ms/op 15.720 ms/op 0.91
getNodesAtDepth depth 2 x100000 17.081 ms/op 18.316 ms/op 0.93
setNodesAtDepth depth 2 x100000 21.208 ms/op 22.968 ms/op 0.92
tree.getNodesAtDepth - gindexes 7.9841 ms/op 8.7213 ms/op 0.92
tree.getNodesAtDepth - push all nodes 1.8904 ms/op 2.4908 ms/op 0.76
tree.getNodesAtDepth - navigation 311.31 us/op 311.60 us/op 1.00
tree.setNodesAtDepth - indexes 635.49 us/op 731.42 us/op 0.87
set at depth 8 701.00 ns/op 801.00 ns/op 0.88
set at depth 16 1.0480 us/op 1.1460 us/op 0.91
set at depth 32 1.7850 us/op 1.9810 us/op 0.90
iterateNodesAtDepth 8 256 13.245 us/op 14.435 us/op 0.92
getNodesAtDepth 8 256 3.5760 us/op 3.7610 us/op 0.95
iterateNodesAtDepth 16 65536 4.4284 ms/op 5.1401 ms/op 0.86
getNodesAtDepth 16 65536 1.5877 ms/op 1.5996 ms/op 0.99
iterateNodesAtDepth 32 250000 16.130 ms/op 15.931 ms/op 1.01
getNodesAtDepth 32 250000 4.4924 ms/op 4.4646 ms/op 1.01
iterateNodesAtDepth 40 250000 15.893 ms/op 15.824 ms/op 1.00
getNodesAtDepth 40 250000 4.4411 ms/op 4.5864 ms/op 0.97
250000 validators root getter 116.43 ms/op 115.88 ms/op 1.00
250000 validators batchHash() 87.147 ms/op 91.401 ms/op 0.95
250000 validators hashComputations 15.011 ms/op 19.528 ms/op 0.77
bitlist bytes to struct (120,90) 1.0090 us/op 743.00 ns/op 1.36
bitlist bytes to tree (120,90) 3.7580 us/op 2.5500 us/op 1.47
bitlist bytes to struct (2048,2048) 1.3640 us/op 990.00 ns/op 1.38
bitlist bytes to tree (2048,2048) 4.8090 us/op 4.0390 us/op 1.19
ByteListType - deserialize 8.4263 ms/op 7.2279 ms/op 1.17
BasicListType - deserialize 18.171 ms/op 14.356 ms/op 1.27
ByteListType - serialize 8.1443 ms/op 7.7393 ms/op 1.05
BasicListType - serialize 11.433 ms/op 9.7326 ms/op 1.17
BasicListType - tree_convertToStruct 28.693 ms/op 26.077 ms/op 1.10
List[uint8, 68719476736] len 300000 ViewDU.getAll() + iterate 5.2557 ms/op 4.7901 ms/op 1.10
List[uint8, 68719476736] len 300000 ViewDU.get(i) 4.3897 ms/op 4.4103 ms/op 1.00
Array.push len 300000 empty Array - number 7.2220 ms/op 6.6991 ms/op 1.08
Array.set len 300000 from new Array - number 1.6689 ms/op 1.7371 ms/op 0.96
Array.set len 300000 - number 5.5261 ms/op 5.5399 ms/op 1.00
Uint8Array.set len 300000 484.74 us/op 480.11 us/op 1.01
Uint32Array.set len 300000 574.24 us/op 539.82 us/op 1.06
Container({a: uint8, b: uint8}) getViewDU x300000 25.443 ms/op 24.820 ms/op 1.03
ContainerNodeStruct({a: uint8, b: uint8}) getViewDU x300000 10.632 ms/op 10.455 ms/op 1.02
List(Container) len 300000 ViewDU.getAllReadonly() + iterate 205.72 ms/op 197.86 ms/op 1.04
List(Container) len 300000 ViewDU.getAllReadonlyValues() + iterate 244.28 ms/op 226.89 ms/op 1.08
List(Container) len 300000 ViewDU.get(i) 6.4319 ms/op 6.3845 ms/op 1.01
List(Container) len 300000 ViewDU.getReadonly(i) 6.4275 ms/op 6.3471 ms/op 1.01
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonly() + iterate 34.428 ms/op 38.556 ms/op 0.89
List(ContainerNodeStruct) len 300000 ViewDU.getAllReadonlyValues() + iterate 6.0431 ms/op 5.2337 ms/op 1.15
List(ContainerNodeStruct) len 300000 ViewDU.get(i) 6.0230 ms/op 6.1641 ms/op 0.98
List(ContainerNodeStruct) len 300000 ViewDU.getReadonly(i) 6.0410 ms/op 6.0643 ms/op 1.00
Array.push len 300000 empty Array - object 6.8096 ms/op 6.4074 ms/op 1.06
Array.set len 300000 from new Array - object 1.8514 ms/op 1.9925 ms/op 0.93
Array.set len 300000 - object 6.0858 ms/op 6.0039 ms/op 1.01
cachePermanentRootStruct no cache 5.2850 us/op 5.0960 us/op 1.04
cachePermanentRootStruct with cache 194.00 ns/op 199.00 ns/op 0.97
epochParticipation len 250000 rws 7813 2.4099 ms/op 2.3262 ms/op 1.04
BeaconState ViewDU hashTreeRoot() vc=200000 112.17 ms/op 112.48 ms/op 1.00
BeaconState ViewDU recursive hash - commit step vc=200000 4.1480 ms/op 4.5695 ms/op 0.91
BeaconState ViewDU validator tree creation vc=10000 40.232 ms/op 39.100 ms/op 1.03
BeaconState ViewDU batchHashTreeRoot vc=200000 106.34 ms/op 98.243 ms/op 1.08
BeaconState ViewDU hashTreeRoot - commit step vc=200000 91.570 ms/op 88.615 ms/op 1.03
BeaconState ViewDU hashTreeRoot - hash step vc=200000 16.907 ms/op 15.568 ms/op 1.09
deserialize Attestation - tree 4.1060 us/op 3.5980 us/op 1.14
deserialize Attestation - struct 2.2710 us/op 1.9260 us/op 1.18
deserialize SignedAggregateAndProof - tree 5.5020 us/op 5.0130 us/op 1.10
deserialize SignedAggregateAndProof - struct 3.6810 us/op 3.0720 us/op 1.20
deserialize SyncCommitteeMessage - tree 1.5960 us/op 1.4160 us/op 1.13
deserialize SyncCommitteeMessage - struct 1.3370 us/op 1.0680 us/op 1.25
deserialize SignedContributionAndProof - tree 3.2950 us/op 2.9390 us/op 1.12
deserialize SignedContributionAndProof - struct 2.7730 us/op 2.3790 us/op 1.17
deserialize SignedBeaconBlock - tree 323.05 us/op 294.19 us/op 1.10
deserialize SignedBeaconBlock - struct 143.47 us/op 123.51 us/op 1.16
BeaconState vc 300000 - deserialize tree 671.95 ms/op 626.16 ms/op 1.07
BeaconState vc 300000 - serialize tree 138.55 ms/op 127.41 ms/op 1.09
BeaconState.historicalRoots vc 300000 - deserialize tree 941.00 ns/op 849.00 ns/op 1.11
BeaconState.historicalRoots vc 300000 - serialize tree 705.00 ns/op 636.00 ns/op 1.11
BeaconState.validators vc 300000 - deserialize tree 629.57 ms/op 600.20 ms/op 1.05
BeaconState.validators vc 300000 - serialize tree 130.41 ms/op 99.082 ms/op 1.32
BeaconState.balances vc 300000 - deserialize tree 27.747 ms/op 27.416 ms/op 1.01
BeaconState.balances vc 300000 - serialize tree 5.2506 ms/op 4.5367 ms/op 1.16
BeaconState.previousEpochParticipation vc 300000 - deserialize tree 1.1078 ms/op 892.01 us/op 1.24
BeaconState.previousEpochParticipation vc 300000 - serialize tree 345.45 us/op 312.54 us/op 1.11
BeaconState.currentEpochParticipation vc 300000 - deserialize tree 1.0716 ms/op 902.60 us/op 1.19
BeaconState.currentEpochParticipation vc 300000 - serialize tree 342.22 us/op 334.63 us/op 1.02
BeaconState.inactivityScores vc 300000 - deserialize tree 29.954 ms/op 28.336 ms/op 1.06
BeaconState.inactivityScores vc 300000 - serialize tree 5.0544 ms/op 3.9001 ms/op 1.30
hashTreeRoot Attestation - struct 21.130 us/op 19.866 us/op 1.06
hashTreeRoot Attestation - tree 9.1290 us/op 9.1020 us/op 1.00
hashTreeRoot SignedAggregateAndProof - struct 26.860 us/op 24.204 us/op 1.11
hashTreeRoot SignedAggregateAndProof - tree 13.703 us/op 13.693 us/op 1.00
hashTreeRoot SyncCommitteeMessage - struct 6.8950 us/op 6.2360 us/op 1.11
hashTreeRoot SyncCommitteeMessage - tree 3.6880 us/op 3.6920 us/op 1.00
hashTreeRoot SignedContributionAndProof - struct 15.753 us/op 14.727 us/op 1.07
hashTreeRoot SignedContributionAndProof - tree 9.4220 us/op 9.3310 us/op 1.01
hashTreeRoot SignedBeaconBlock - struct 1.3988 ms/op 1.2232 ms/op 1.14
hashTreeRoot SignedBeaconBlock - tree 822.77 us/op 825.90 us/op 1.00
hashTreeRoot Validator - struct 9.2060 us/op 7.7160 us/op 1.19
hashTreeRoot Validator - tree 8.0150 us/op 6.8910 us/op 1.16
BeaconState vc 300000 - hashTreeRoot tree 2.3764 s/op 2.2144 s/op 1.07
BeaconState vc 300000 - batchHashTreeRoot tree 4.4199 s/op 4.0718 s/op 1.09
BeaconState.historicalRoots vc 300000 - hashTreeRoot tree 1.0620 us/op 998.00 ns/op 1.06
BeaconState.validators vc 300000 - hashTreeRoot tree 2.6258 s/op 2.4050 s/op 1.09
BeaconState.balances vc 300000 - hashTreeRoot tree 34.717 ms/op 35.352 ms/op 0.98
BeaconState.previousEpochParticipation vc 300000 - hashTreeRoot tree 4.3257 ms/op 4.3136 ms/op 1.00
BeaconState.currentEpochParticipation vc 300000 - hashTreeRoot tree 4.3117 ms/op 4.3078 ms/op 1.00
BeaconState.inactivityScores vc 300000 - hashTreeRoot tree 34.776 ms/op 38.126 ms/op 0.91
hash64 x18 9.5240 us/op 8.7420 us/op 1.09
hashTwoObjects x18 8.0140 us/op 8.3110 us/op 0.96
hash64 x1740 879.45 us/op 796.95 us/op 1.10
hashTwoObjects x1740 754.29 us/op 746.70 us/op 1.01
hash64 x2700000 1.3546 s/op 1.2300 s/op 1.10
hashTwoObjects x2700000 1.1814 s/op 1.1605 s/op 1.02
get_exitEpoch - ContainerType 324.00 ns/op 231.00 ns/op 1.40
get_exitEpoch - ContainerNodeStructType 321.00 ns/op 229.00 ns/op 1.40
set_exitEpoch - ContainerType 347.00 ns/op 252.00 ns/op 1.38
set_exitEpoch - ContainerNodeStructType 326.00 ns/op 232.00 ns/op 1.41
get_pubkey - ContainerType 1.2180 us/op 927.00 ns/op 1.31
get_pubkey - ContainerNodeStructType 315.00 ns/op 223.00 ns/op 1.41
hashTreeRoot - ContainerType 498.00 ns/op 392.00 ns/op 1.27
hashTreeRoot - ContainerNodeStructType 443.00 ns/op 358.00 ns/op 1.24
createProof - ContainerType 5.1980 us/op 3.8400 us/op 1.35
createProof - ContainerNodeStructType 28.357 us/op 21.848 us/op 1.30
serialize - ContainerType 2.0750 us/op 1.7040 us/op 1.22
serialize - ContainerNodeStructType 1.7750 us/op 1.4030 us/op 1.27
set_exitEpoch_and_hashTreeRoot - ContainerType 3.2710 us/op 2.9300 us/op 1.12
set_exitEpoch_and_hashTreeRoot - ContainerNodeStructType 8.0460 us/op 7.3560 us/op 1.09
Array - for of 5.5770 us/op 7.4930 us/op 0.74
Array - for(;;) 5.5850 us/op 6.7180 us/op 0.83
basicListValue.readonlyValuesArray() 5.5556 ms/op 4.2245 ms/op 1.32
basicListValue.readonlyValuesArray() + loop all 5.6156 ms/op 4.2879 ms/op 1.31
compositeListValue.readonlyValuesArray() 33.862 ms/op 28.068 ms/op 1.21
compositeListValue.readonlyValuesArray() + loop all 33.599 ms/op 32.030 ms/op 1.05
Number64UintType - get balances list 5.0750 ms/op 4.6109 ms/op 1.10
Number64UintType - set balances list 10.233 ms/op 10.105 ms/op 1.01
Number64UintType - get and increase 10 then set 45.236 ms/op 46.189 ms/op 0.98
Number64UintType - increase 10 using applyDelta 18.446 ms/op 16.394 ms/op 1.13
Number64UintType - increase 10 using applyDeltaInBatch 18.431 ms/op 16.492 ms/op 1.12
tree_newTreeFromUint64Deltas 24.967 ms/op 20.557 ms/op 1.21
unsafeUint8ArrayToTree 41.782 ms/op 37.853 ms/op 1.10
bitLength(50) 275.00 ns/op 217.00 ns/op 1.27
bitLengthStr(50) 241.00 ns/op 208.00 ns/op 1.16
bitLength(8000) 273.00 ns/op 209.00 ns/op 1.31
bitLengthStr(8000) 271.00 ns/op 255.00 ns/op 1.06
bitLength(250000) 270.00 ns/op 210.00 ns/op 1.29
bitLengthStr(250000) 285.00 ns/op 291.00 ns/op 0.98
floor - Math.floor (53) 1.2442 ns/op 1.2468 ns/op 1.00
floor - << 0 (53) 1.2460 ns/op 1.2440 ns/op 1.00
floor - Math.floor (512) 1.2441 ns/op 1.2439 ns/op 1.00
floor - << 0 (512) 1.2430 ns/op 1.2669 ns/op 0.98
fnIf(0) 1.5594 ns/op 1.5551 ns/op 1.00
fnSwitch(0) 2.1813 ns/op 2.1827 ns/op 1.00
fnObj(0) 1.5558 ns/op 1.5592 ns/op 1.00
fnArr(0) 1.5538 ns/op 1.5557 ns/op 1.00
fnIf(4) 2.2031 ns/op 2.1812 ns/op 1.01
fnSwitch(4) 2.1767 ns/op 2.1777 ns/op 1.00
fnObj(4) 1.5699 ns/op 1.5568 ns/op 1.01
fnArr(4) 1.6005 ns/op 1.5777 ns/op 1.01
fnIf(9) 3.1161 ns/op 3.1089 ns/op 1.00
fnSwitch(9) 2.1767 ns/op 2.1768 ns/op 1.00
fnObj(9) 1.5572 ns/op 1.5626 ns/op 1.00
fnArr(9) 1.5595 ns/op 1.5543 ns/op 1.00
Container {a,b,vec} - as struct x100000 125.18 us/op 125.02 us/op 1.00
Container {a,b,vec} - as tree x100000 902.26 us/op 559.98 us/op 1.61
Container {a,vec,b} - as struct x100000 155.69 us/op 155.71 us/op 1.00
Container {a,vec,b} - as tree x100000 559.71 us/op 561.24 us/op 1.00
get 2 props x1000000 - rawObject 312.15 us/op 312.25 us/op 1.00
get 2 props x1000000 - proxy 73.076 ms/op 73.895 ms/op 0.99
get 2 props x1000000 - customObj 311.82 us/op 313.10 us/op 1.00
Simple object binary -> struct 904.00 ns/op 574.00 ns/op 1.57
Simple object binary -> tree_backed 2.4570 us/op 1.7190 us/op 1.43
Simple object struct -> tree_backed 2.8580 us/op 2.1960 us/op 1.30
Simple object tree_backed -> struct 2.5090 us/op 1.4930 us/op 1.68
Simple object struct -> binary 1.2190 us/op 811.00 ns/op 1.50
Simple object tree_backed -> binary 1.7010 us/op 1.2420 us/op 1.37
aggregationBits binary -> struct 711.00 ns/op 480.00 ns/op 1.48
aggregationBits binary -> tree_backed 3.0770 us/op 2.0790 us/op 1.48
aggregationBits struct -> tree_backed 3.5360 us/op 2.4660 us/op 1.43
aggregationBits tree_backed -> struct 1.3230 us/op 922.00 ns/op 1.43
aggregationBits struct -> binary 890.00 ns/op 650.00 ns/op 1.37
aggregationBits tree_backed -> binary 1.2820 us/op 825.00 ns/op 1.55
List(uint8) 100000 binary -> struct 1.8413 ms/op 1.7624 ms/op 1.04
List(uint8) 100000 binary -> tree_backed 345.92 us/op 273.22 us/op 1.27
List(uint8) 100000 struct -> tree_backed 1.4993 ms/op 1.4638 ms/op 1.02
List(uint8) 100000 tree_backed -> struct 1.1339 ms/op 1.1198 ms/op 1.01
List(uint8) 100000 struct -> binary 1.1018 ms/op 1.0992 ms/op 1.00
List(uint8) 100000 tree_backed -> binary 119.35 us/op 114.74 us/op 1.04
List(uint64Number) 100000 binary -> struct 1.5632 ms/op 1.4048 ms/op 1.11
List(uint64Number) 100000 binary -> tree_backed 5.1024 ms/op 5.0190 ms/op 1.02
List(uint64Number) 100000 struct -> tree_backed 7.2513 ms/op 6.1059 ms/op 1.19
List(uint64Number) 100000 tree_backed -> struct 2.6660 ms/op 2.4342 ms/op 1.10
List(uint64Number) 100000 struct -> binary 1.7512 ms/op 1.5826 ms/op 1.11
List(uint64Number) 100000 tree_backed -> binary 1.0646 ms/op 1.0330 ms/op 1.03
List(Uint64Bigint) 100000 binary -> struct 4.0859 ms/op 3.7095 ms/op 1.10
List(Uint64Bigint) 100000 binary -> tree_backed 5.6494 ms/op 5.0164 ms/op 1.13
List(Uint64Bigint) 100000 struct -> tree_backed 7.8123 ms/op 8.1592 ms/op 0.96
List(Uint64Bigint) 100000 tree_backed -> struct 5.7769 ms/op 5.1796 ms/op 1.12
List(Uint64Bigint) 100000 struct -> binary 2.1027 ms/op 2.0661 ms/op 1.02
List(Uint64Bigint) 100000 tree_backed -> binary 1.6603 ms/op 1.2860 ms/op 1.29
Vector(Root) 100000 binary -> struct 42.351 ms/op 37.432 ms/op 1.13
Vector(Root) 100000 binary -> tree_backed 38.404 ms/op 42.356 ms/op 0.91
Vector(Root) 100000 struct -> tree_backed 53.133 ms/op 49.278 ms/op 1.08
Vector(Root) 100000 tree_backed -> struct 52.651 ms/op 49.389 ms/op 1.07
Vector(Root) 100000 struct -> binary 2.8499 ms/op 2.7343 ms/op 1.04
Vector(Root) 100000 tree_backed -> binary 6.6887 ms/op 6.5106 ms/op 1.03
List(Validator) 100000 binary -> struct 115.15 ms/op 107.22 ms/op 1.07
List(Validator) 100000 binary -> tree_backed 381.87 ms/op 320.95 ms/op 1.19
List(Validator) 100000 struct -> tree_backed 392.67 ms/op 373.91 ms/op 1.05
List(Validator) 100000 tree_backed -> struct 214.48 ms/op 202.44 ms/op 1.06
List(Validator) 100000 struct -> binary 29.671 ms/op 28.992 ms/op 1.02
List(Validator) 100000 tree_backed -> binary 113.84 ms/op 105.77 ms/op 1.08
List(Validator-NS) 100000 binary -> struct 111.26 ms/op 117.19 ms/op 0.95
List(Validator-NS) 100000 binary -> tree_backed 177.80 ms/op 159.64 ms/op 1.11
List(Validator-NS) 100000 struct -> tree_backed 213.83 ms/op 208.31 ms/op 1.03
List(Validator-NS) 100000 tree_backed -> struct 174.46 ms/op 169.86 ms/op 1.03
List(Validator-NS) 100000 struct -> binary 29.695 ms/op 28.812 ms/op 1.03
List(Validator-NS) 100000 tree_backed -> binary 34.696 ms/op 34.085 ms/op 1.02
get epochStatuses - MutableVector 107.22 us/op 98.762 us/op 1.09
get epochStatuses - ViewDU 213.77 us/op 213.39 us/op 1.00
set epochStatuses - ListTreeView 2.1804 ms/op 2.1305 ms/op 1.02
set epochStatuses - ListTreeView - set() 480.31 us/op 446.33 us/op 1.08
set epochStatuses - ListTreeView - commit() 812.77 us/op 731.49 us/op 1.11
bitstring 514.82 ns/op 513.77 ns/op 1.00
bit mask 13.508 ns/op 13.799 ns/op 0.98
struct - increase slot to 1000000 932.67 us/op 933.62 us/op 1.00
UintNumberType - increase slot to 1000000 28.317 ms/op 27.711 ms/op 1.02
UintBigintType - increase slot to 1000000 177.02 ms/op 171.34 ms/op 1.03
UintBigint8 x 100000 tree_deserialize 6.4688 ms/op 4.8651 ms/op 1.33
UintBigint8 x 100000 tree_serialize 1.1388 ms/op 1.1287 ms/op 1.01
UintBigint16 x 100000 tree_deserialize 5.5755 ms/op 6.0631 ms/op 0.92
UintBigint16 x 100000 tree_serialize 1.4370 ms/op 1.3632 ms/op 1.05
UintBigint32 x 100000 tree_deserialize 5.9731 ms/op 5.5379 ms/op 1.08
UintBigint32 x 100000 tree_serialize 1.9622 ms/op 1.8300 ms/op 1.07
UintBigint64 x 100000 tree_deserialize 6.1033 ms/op 6.2323 ms/op 0.98
UintBigint64 x 100000 tree_serialize 2.5609 ms/op 2.4893 ms/op 1.03
UintBigint8 x 100000 value_deserialize 436.48 us/op 437.44 us/op 1.00
UintBigint8 x 100000 value_serialize 830.09 us/op 771.83 us/op 1.08
UintBigint16 x 100000 value_deserialize 468.29 us/op 466.78 us/op 1.00
UintBigint16 x 100000 value_serialize 887.53 us/op 814.65 us/op 1.09
UintBigint32 x 100000 value_deserialize 497.89 us/op 497.55 us/op 1.00
UintBigint32 x 100000 value_serialize 922.37 us/op 851.55 us/op 1.08
UintBigint64 x 100000 value_deserialize 562.46 us/op 561.32 us/op 1.00
UintBigint64 x 100000 value_serialize 1.2456 ms/op 1.0346 ms/op 1.20
UintBigint8 x 100000 deserialize 3.8521 ms/op 3.1338 ms/op 1.23
UintBigint8 x 100000 serialize 1.5538 ms/op 1.5236 ms/op 1.02
UintBigint16 x 100000 deserialize 4.1352 ms/op 3.1959 ms/op 1.29
UintBigint16 x 100000 serialize 1.6207 ms/op 1.5486 ms/op 1.05
UintBigint32 x 100000 deserialize 4.2757 ms/op 3.2662 ms/op 1.31
UintBigint32 x 100000 serialize 2.9465 ms/op 2.8154 ms/op 1.05
UintBigint64 x 100000 deserialize 4.3002 ms/op 4.2641 ms/op 1.01
UintBigint64 x 100000 serialize 1.6422 ms/op 1.7528 ms/op 0.94
UintBigint128 x 100000 deserialize 5.8833 ms/op 5.5805 ms/op 1.05
UintBigint128 x 100000 serialize 15.511 ms/op 15.764 ms/op 0.98
UintBigint256 x 100000 deserialize 9.1213 ms/op 8.9411 ms/op 1.02
UintBigint256 x 100000 serialize 44.746 ms/op 45.903 ms/op 0.97
Slice from Uint8Array x25000 1.8066 ms/op 1.3955 ms/op 1.29
Slice from ArrayBuffer x25000 17.496 ms/op 15.878 ms/op 1.10
Slice from ArrayBuffer x25000 + new Uint8Array 19.831 ms/op 16.324 ms/op 1.21
Copy Uint8Array 100000 iterate 2.6745 ms/op 2.7272 ms/op 0.98
Copy Uint8Array 100000 slice 141.89 us/op 95.870 us/op 1.48
Copy Uint8Array 100000 Uint8Array.prototype.slice.call 144.24 us/op 87.975 us/op 1.64
Copy Buffer 100000 Uint8Array.prototype.slice.call 143.41 us/op 90.034 us/op 1.59
Copy Uint8Array 100000 slice + set 294.63 us/op 177.75 us/op 1.66
Copy Uint8Array 100000 subarray + set 146.99 us/op 88.467 us/op 1.66
Copy Uint8Array 100000 slice arrayBuffer 140.84 us/op 91.189 us/op 1.54
Uint64 deserialize 100000 - iterate Uint8Array 2.1296 ms/op 1.9793 ms/op 1.08
Uint64 deserialize 100000 - by Uint32A 2.0800 ms/op 2.0172 ms/op 1.03
Uint64 deserialize 100000 - by DataView.getUint32 x2 2.1366 ms/op 1.8379 ms/op 1.16
Uint64 deserialize 100000 - by DataView.getBigUint64 5.3924 ms/op 4.8271 ms/op 1.12
Uint64 deserialize 100000 - by byte 41.877 ms/op 40.847 ms/op 1.03

by benchmarkbot/action

@nazarhussain nazarhussain requested a review from twoeths February 26, 2025 13:27
Copy link
Contributor

@twoeths twoeths left a comment

Choose a reason for hiding this comment

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

lgtm

@wemeetagain wemeetagain merged commit 089daed into master Feb 27, 2025
12 checks passed
@wemeetagain wemeetagain deleted the nh/deno-unit-tests branch February 27, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants