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

Add more tests #207

Merged
merged 10 commits into from
Oct 12, 2021
Merged

Add more tests #207

merged 10 commits into from
Oct 12, 2021

Conversation

dapplion
Copy link
Contributor

Motivation

In preparation for #197 it's important to increase test coverage to ensure stability

Description

Increase coverage in ssz with

  • More tests by type testing serdes in struct + tree, clone, equal, and merkelization
  • Copy the entire types from Lodestar and add script to do that in one command
  • Add merge ssz_static tests

@github-actions
Copy link

github-actions bot commented Oct 12, 2021

Performance Report

✔️ no performance regression detected

Full benchmark results
Benchmark suite Current: 1949c13 Previous: b4463f8 Ratio
bitlist bytes to struct (120,90) 32.017 us/op
bitlist bytes to tree (120,90) 2.2650 us/op
bitlist bytes to struct (2048,2048) 524.95 us/op
bitlist bytes to tree (2048,2048) 6.6710 us/op
deserialize Attestation - struct 38.990 us/op
deserialize Attestation - tree 12.786 us/op
deserialize SignedAggregateAndProof - struct 49.193 us/op
deserialize SignedAggregateAndProof - tree 17.648 us/op
deserialize SignedContributionAndProof - struct 37.595 us/op
epochParticipation len 250000 rws 7813 23.747 ms/op
Array - for of 10.512 us/op 8.9410 us/op 1.18
Array - for(;;) 7.1370 us/op 8.2560 us/op 0.86
basicListValue.readonlyValues() 217.37 ms/op 232.35 ms/op 0.94
basicListValue.readonlyValuesArray() 196.41 ms/op 203.64 ms/op 0.96
basicListValue.readonlyValues() + iterate all 210.29 ms/op 223.21 ms/op 0.94
basicListValue.readonlyValuesArray() + loop all 196.87 ms/op 206.80 ms/op 0.95
compositeListValue.readonlyValues() 230.46 ms/op 314.52 ms/op 0.73
compositeListValue.readonlyValuesArray() 241.40 ms/op 313.44 ms/op 0.77
compositeListValue.readonlyValues() + iterate all 157.95 ms/op 220.01 ms/op 0.72
compositeListValue.readonlyValuesArray() + loop all 223.59 ms/op 292.11 ms/op 0.77
NumberUintType - get balances list 714.39 ms/op 994.97 ms/op 0.72
Number64UintType - get balances list 415.46 ms/op 539.48 ms/op 0.77
NumberUintType - set balances list 1.1022 s/op 1.4333 s/op 0.77
Number64UintType - set balances list 840.13 ms/op 1.2060 s/op 0.70
Number64UintType - get and increase 10 then set 1.2391 s/op 1.5782 s/op 0.79
Number64UintType - increase 10 using applyDelta 469.42 ms/op 609.24 ms/op 0.77
Number64UintType - increase 10 using applyDeltaInBatch 469.67 ms/op 610.87 ms/op 0.77
tree_newTreeFromUint64Deltas 45.805 ms/op 49.739 ms/op 0.92
unsafeUint8ArrayToTree 50.221 ms/op 58.597 ms/op 0.86
Container {a,b,vec} - as struct x100000 50.924 us/op 71.920 us/op 0.71
Container {a,b,vec} - as tree x100000 90.830 ms/op 100.18 ms/op 0.91
Container {a,vec,b} - as struct x100000 100.91 us/op 109.74 us/op 0.92
Container {a,vec,b} - as tree x100000 90.365 ms/op 103.44 ms/op 0.87
Simple object binary -> struct 2.0210 us/op 2.3570 us/op 0.86
Simple object binary -> tree_backed 2.3050 us/op 3.0500 us/op 0.76
Simple object struct -> tree_backed 1.6850 us/op 2.2720 us/op 0.74
Simple object tree_backed -> struct 1.7330 us/op 2.2610 us/op 0.77
Simple object struct -> binary 2.0620 us/op 2.2900 us/op 0.90
Simple object tree_backed -> binary 3.2550 us/op 4.1670 us/op 0.78
aggregationBits binary -> struct 33.065 us/op 40.718 us/op 0.81
aggregationBits binary -> tree_backed 1.7540 us/op 2.4250 us/op 0.72
aggregationBits struct -> tree_backed 4.9200 us/op 6.3320 us/op 0.78
aggregationBits tree_backed -> struct 33.179 us/op 45.724 us/op 0.73
aggregationBits struct -> binary 3.8790 us/op 4.8400 us/op 0.80
aggregationBits tree_backed -> binary 5.0300 us/op 5.7830 us/op 0.87
List(BigInt) 1000 binary -> struct 357.06 us/op 448.38 us/op 0.80
List(BigInt) 1000 binary -> tree_backed 236.39 us/op 324.17 us/op 0.73
List(BigInt) 1000 struct -> tree_backed 286.70 us/op 347.03 us/op 0.83
List(BigInt) 1000 tree_backed -> struct 846.20 us/op 1.0744 ms/op 0.79
List(BigInt) 1000 struct -> binary 185.51 us/op 243.32 us/op 0.76
List(BigInt) 1000 tree_backed -> binary 37.345 us/op 62.471 us/op 0.60
List(BigInt) 10000 binary -> struct 3.5447 ms/op 4.4341 ms/op 0.80
List(BigInt) 10000 binary -> tree_backed 2.9038 ms/op 3.7017 ms/op 0.78
List(BigInt) 10000 struct -> tree_backed 2.9095 ms/op 3.3901 ms/op 0.86
List(BigInt) 10000 tree_backed -> struct 10.131 ms/op 12.806 ms/op 0.79
List(BigInt) 10000 struct -> binary 1.8538 ms/op 2.2707 ms/op 0.82
List(BigInt) 10000 tree_backed -> binary 345.22 us/op 446.33 us/op 0.77
List(BigInt) 100000 binary -> struct 45.604 ms/op 57.367 ms/op 0.79
List(BigInt) 100000 binary -> tree_backed 44.168 ms/op 53.381 ms/op 0.83
List(BigInt) 100000 struct -> tree_backed 38.147 ms/op 42.422 ms/op 0.90
List(BigInt) 100000 tree_backed -> struct 123.64 ms/op 151.74 ms/op 0.81
List(BigInt) 100000 struct -> binary 18.522 ms/op 22.706 ms/op 0.82
List(BigInt) 100000 tree_backed -> binary 3.7905 ms/op 4.9690 ms/op 0.76
struct - increase slot to 1000000 2.6919 ms/op 3.0433 ms/op 0.88
NumberUintType - increase slot to 1000000 1.1825 s/op 1.3804 s/op 0.86
Number64UintType - increase slot to 1000000 327.50 ms/op 439.48 ms/op 0.75
get_exitEpoch - ContainerType 681.00 ns/op 1.7830 us/op 0.38
get_exitEpoch - ContainerLeafNodeStructType 546.00 ns/op 761.00 ns/op 0.72
set_exitEpoch - ContainerType 756.00 ns/op 1.2140 us/op 0.62
set_exitEpoch - ContainerLeafNodeStructType 936.00 ns/op 1.3380 us/op 0.70
get_pubkey - ContainerType 1.8940 us/op 2.8620 us/op 0.66
get_pubkey - ContainerLeafNodeStructType 587.00 ns/op 844.00 ns/op 0.70
hashTreeRoot - ContainerType 719.00 ns/op 970.00 ns/op 0.74
hashTreeRoot - ContainerLeafNodeStructType 745.00 ns/op 1.0010 us/op 0.74
createProof - ContainerType 6.9180 us/op 10.812 us/op 0.64
createProof - ContainerLeafNodeStructType 25.498 us/op 37.701 us/op 0.68
serialize - ContainerType 5.3920 us/op 7.2240 us/op 0.75
serialize - ContainerLeafNodeStructType 2.9650 us/op 4.2780 us/op 0.69
set_exitEpoch_and_hashTreeRoot - ContainerType 7.1230 us/op 11.567 us/op 0.62
set_exitEpoch_and_hashTreeRoot - ContainerLeafNodeStructType 25.775 us/op 38.947 us/op 0.66

by benchmarkbot/action

@dapplion dapplion merged commit 3944763 into master Oct 12, 2021
@dapplion dapplion deleted the dapplion/more-tests branch October 12, 2021 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants