CGO_CFLAGS="-O2 -D__BLST_PORTABLE__" go test -bench=Benchmark
kev@kev-Venus-series:~/Documents/c-kzg-4844/bindings/go$ go test -bench=Benchmark
goos: linux
goarch: amd64
pkg: github.com/ethereum/c-kzg-4844/v2/bindings/go
cpu: AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Benchmark/LoadTrustedSetupFile(precompute=0)-16 1 1394717117 ns/op
Benchmark/LoadTrustedSetupFile(precompute=1)-16 1 1408454235 ns/op
Benchmark/LoadTrustedSetupFile(precompute=2)-16 1 1412673856 ns/op
Benchmark/LoadTrustedSetupFile(precompute=3)-16 1 1419016199 ns/op
Benchmark/LoadTrustedSetupFile(precompute=4)-16 1 1431446363 ns/op
Benchmark/LoadTrustedSetupFile(precompute=5)-16 1 1466623309 ns/op
Benchmark/LoadTrustedSetupFile(precompute=6)-16 1 1532625645 ns/op
Benchmark/LoadTrustedSetupFile(precompute=7)-16 1 1662807662 ns/op
Benchmark/LoadTrustedSetupFile(precompute=8)-16 1 1907756100 ns/op
Benchmark/BlobToKZGCommitment-16 30 36600410 ns/op
Benchmark/ComputeKZGProof-16 27 38385196 ns/op
Benchmark/ComputeBlobKZGProof-16 28 38668432 ns/op
Benchmark/VerifyKZGProof-16 1177 990180 ns/op
Benchmark/VerifyBlobKZGProof-16 776 1506935 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=1)-16 778 1501541 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=2)-16 474 2519688 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=4)-16 268 4423528 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=8)-16 144 8271799 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=16)-16 64 15952359 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=32)-16 34 31163175 ns/op
Benchmark/VerifyBlobKZGProofBatch(count=64)-16 19 61739902 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=0)-16 5 244328564 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=1)-16 2 701216710 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=2)-16 3 375410633 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=3)-16 4 270435574 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=4)-16 5 216609944 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=5)-16 6 191803162 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=6)-16 6 173200520 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=7)-16 7 161299380 ns/op
Benchmark/ComputeCellsAndKZGProofs(precompute=8)-16 7 148498287 ns/op
Benchmark/ComputeCellsAndKZGProofsParallel(count=16)-16 4 260367648 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=50.0%)-16 7 164430762 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=25.0%)-16 7 164928728 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=12.5%)-16 7 164960470 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=1)-16 7 165075666 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=2)-16 7 164537528 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=3)-16 7 165259001 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=4)-16 7 165268926 ns/op
Benchmark/RecoverCellsAndKZGProofs(missing=5)-16 7 164077475 ns/op
Benchmark/VerifyCellKZGProofBatch-16 2 550388758 ns/op
Benchmark/VerifyRows(count=1)-16 73 14228048 ns/op
Benchmark/VerifyRows(count=2)-16 48 23678148 ns/op
Benchmark/VerifyRows(count=4)-16 27 42144006 ns/op
Benchmark/VerifyRows(count=8)-16 14 77477099 ns/op
Benchmark/VerifyRows(count=16)-16 7 146870877 ns/op
Benchmark/VerifyRows(count=32)-16 4 281355200 ns/op
Benchmark/VerifyRows(count=64)-16 2 546973902 ns/op
Benchmark/VerifyColumns(count=1)-16 94 12637694 ns/op
Benchmark/VerifyColumns(count=2)-16 60 17366677 ns/op
Benchmark/VerifyColumns(count=4)-16 42 26782584 ns/op
Benchmark/VerifyColumns(count=8)-16 25 45055038 ns/op
Benchmark/VerifyColumns(count=16)-16 14 80036576 ns/op
Benchmark/VerifyColumns(count=32)-16 7 149521468 ns/op
Benchmark/VerifyColumns(count=64)-16 4 282338946 ns/op
Benchmark/VerifyColumns(count=128)-16 2 545218524 ns/op
PASS
ok github.com/ethereum/c-kzg-4844/v2/bindings/go 138.147s
kev@kev-Venus-series:~/Documents/c-kzg-4844/bindings/go$
Environment:
Desc: The table below shows the amount of time needed to load the trusted setup file that is used to compute and verify proofs. This is done once on startup, but should ideally be fast enough such that it does not make client test suites too slow.
Precompute Level | Time (ns/op) | Time (ms/op) |
---|---|---|
0 | 1,394,717,117 | 1,394.72 |
1 | 1,408,454,235 | 1,408.45 |
2 | 1,412,673,856 | 1,412.67 |
3 | 1,419,016,199 | 1,419.02 |
4 | 1,431,446,363 | 1,431.45 |
5 | 1,466,623,309 | 1,466.62 |
6 | 1,532,625,645 | 1,532.63 |
7 | 1,662,807,662 | 1,662.81 |
8 | 1,907,756,100 | 1,907.76 |
Desc: The table below shows the basic operations needed for EIP4844, including the precompile.
Operation | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
BlobToKZGCommitment | 30 | 36,600,410 | 36.60 |
ComputeKZGProof | 27 | 38,385,196 | 38.39 |
ComputeBlobKZGProof | 28 | 38,668,432 | 38.67 |
VerifyKZGProof | 1,177 | 990,180 | 0.99 |
VerifyBlobKZGProof | 776 | 1,506,935 | 1.51 |
Desc: The table below shows the time it takes to batch verify N
KZG proofs, where N
is the blob count.
Blob Count | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
1 | 778 | 1,501,541 | 1.50 |
2 | 474 | 2,519,688 | 2.52 |
4 | 268 | 4,423,528 | 4.42 |
8 | 144 | 8,271,799 | 8.27 |
16 | 64 | 15,952,359 | 15.95 |
32 | 34 | 31,163,175 | 31.16 |
64 | 19 | 61,739,902 | 61.74 |
Desc: The table below shows the time it takes to compute all cells and kzg proofs for an extended blob.
At it's core, we are computing kzg multiopening proofs where each proof attest to 64 field elements, and the polynomial has 8192 evaluations.
Precompute Level | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
0 | 5 | 244,328,564 | 244.33 |
1 | 2 | 701,216,710 | 701.22 |
2 | 3 | 375,410,633 | 375.41 |
3 | 4 | 270,435,574 | 270.44 |
4 | 5 | 216,609,944 | 216.61 |
5 | 6 | 191,803,162 | 191.80 |
6 | 6 | 173,200,520 | 173.20 |
7 | 7 | 161,299,380 | 161.30 |
8 | 7 | 148,498,287 | 148.50 |
Desc: The table below shows the time it takes to compute cells and proofs and verify a batch of proofs using parallelism.
Operation | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
ComputeCellsAndKZGProofsParallel (count=16) | 4 | 260,367,648 | 260.37 |
VerifyCellKZGProofBatch | 2 | 550,388,758 | 550.39 |
Desc: The table below shows the time it takes to recover a polynomial, given some of its elements are missing and also compute the cells and proofs for that polynomial/blob.
Missing Elements | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
50.0% | 7 | 164,430,762 | 164.43 |
25.0% | 7 | 164,928,728 | 164.93 |
12.5% | 7 | 164,960,470 | 164.96 |
1 | 7 | 165,075,666 | 165.08 |
2 | 7 | 164,537,528 | 164.54 |
3 | 7 | 165,259,001 | 165.26 |
4 | 7 | 165,268,926 | 165.27 |
5 | 7 | 164,077,475 | 164.08 |
Desc: The table below shows the time it takes to verify N
rows.
Count | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
1 | 73 | 14,228,048 | 14.23 |
2 | 48 | 23,678,148 | 23.68 |
4 | 27 | 42,144,006 | 42.14 |
8 | 14 | 77,477,099 | 77.48 |
16 | 7 | 146,870,877 | 146.87 |
32 | 4 | 281,355,200 | 281.36 |
64 | 2 | 546,973,902 | 546.97 |
Desc: The table below shows the time it takes to verify N
columns.
Count | Iterations | Time (ns/op) | Time (ms/op) |
---|---|---|---|
1 | 94 | 12,637,694 | 12.64 |
2 | 60 | 17,366,677 | 17.37 |
4 | 42 | 26,782,584 | 26.78 |
8 | 25 | 45,055,038 | 45.06 |
16 | 14 | 80,036,576 | 80.04 |
32 | 7 | 149,521,468 | 149.52 |
64 | 4 | 282,338,946 | 282.34 |
128 | 2 | 545,218,524 | 545.22 |
After running justin's command