Skip to content

Commit a33c065

Browse files
committed
bls: Add bls mul and msm benchmark tests for long inputs
1 parent 8e4a055 commit a33c065

File tree

5 files changed

+292
-4
lines changed

5 files changed

+292
-4
lines changed

parse.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import csv
2+
import re
3+
import sys
4+
5+
pattern = re.compile('.*PrecompileId::(\w+), (\w+)[^/]*(/(\d+))?_(mean|stddev)')
6+
7+
data = []
8+
9+
with open(sys.argv[1], newline='') as csvfile:
10+
reader = csv.reader(csvfile)
11+
for row in reader:
12+
name = row[0]
13+
r = re.match(pattern, name)
14+
if r:
15+
id = r.group(1)
16+
impl = r.group(2)
17+
count = r.group(4) if r.group(4) else '1'
18+
type = r.group(5)
19+
if type == 'mean':
20+
data.append([id, impl, count, row[3]])
21+
elif type == 'stddev':
22+
data[-1].append(row[3])
23+
# print(count, row[3])
24+
# print(r.group(0), r.group(1), r.group(2), r.group(3), r.group(4), r.group(5))
25+
# if "_mean" in name:
26+
# print(', '.join(row))
27+
28+
for d in data:
29+
print(",".join(d))

test/precompiles_bench/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ target_include_directories(evmone-precompiles-bench PRIVATE ..)
88
target_link_libraries(evmone-precompiles-bench PRIVATE evmone::state benchmark::benchmark)
99
target_sources(
1010
evmone-precompiles-bench PRIVATE
11+
bls_bench_input.hpp
12+
bls_bench_input.cpp
1113
precompiles_bench.cpp
1214
)
1315

+173
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
#include "bls_bench_input.hpp"
2+
#include "intx/intx.hpp"
3+
#include "utils/utils.hpp"
4+
5+
#include <array>
6+
7+
namespace evmone::test
8+
{
9+
namespace
10+
{
11+
12+
using PointsArrayType = std::array<std::pair<evmc::bytes, evmc::bytes>, 10>;
13+
14+
[[nodiscard]] std::array<evmc::bytes, 5> generate_mul_input(
15+
const intx::uint256& scalar, const PointsArrayType& test_points) noexcept
16+
{
17+
std::array<evmc::bytes, 5> result;
18+
19+
const auto scalar_be = bytes(intx::be::store<evmc::bytes32>(scalar).bytes, 32);
20+
21+
for (size_t i = 0; i < 5; ++i)
22+
{
23+
const auto array_idx = i % test_points.size();
24+
result[i] = test_points[array_idx].first + test_points[array_idx].second + scalar_be;
25+
}
26+
27+
return result;
28+
}
29+
30+
[[nodiscard]] evmc::bytes generate_msm_input(
31+
size_t num, const intx::uint256& scalar, const PointsArrayType& test_points) noexcept
32+
{
33+
evmc::bytes result;
34+
35+
const auto scalar_be = bytes(intx::be::store<evmc::bytes32>(scalar).bytes, 32);
36+
37+
for (size_t i = 0; i < num; ++i)
38+
{
39+
const auto array_idx = i % test_points.size();
40+
result += test_points[array_idx].first + test_points[array_idx].second + scalar_be;
41+
}
42+
43+
return result;
44+
}
45+
46+
using evmone::test::operator""_hex;
47+
48+
const PointsArrayType g1_test_points{
49+
{{"00000000000000000000000000000000076d5eda8e65c56c1195d2095892454f00da8760b4a42065869bee08c127872540f116e6dd447ed08f61e87655b7d802"_hex,
50+
"0000000000000000000000000000000012e9a031b228aa9f4293db75008d6eb48142854deed8273a24f7f4e9ead2e73659e47f3dcb9d80f33fd66686bdb380bd"_hex},
51+
{"0000000000000000000000000000000015e68a7b3257373d0d7d661a863a95ee722e3576d2208283553b602c405a0b9bf4ef03f50754b28352d1eee37f98afc5"_hex,
52+
"00000000000000000000000000000000123438727f2e017f2ce0acd494cd7ea7394467fa6c16e87c8ef48027136bb345be8c5a2f129db2eaee60f3e45053f95f"_hex},
53+
{
54+
"0000000000000000000000000000000014e14fe19cd378a3351b764afc8c13b63d1bda36f3f261d53ae3bc189677d4f12ef388b195e9ae4edf630ee43fd5ad4d"_hex,
55+
"000000000000000000000000000000000de02bdcac42f674df16b61208bf8fec06abb73f725a0742dbf699b681bfa05168a865688bd6a7a3c0eda7ccd57f5202"_hex,
56+
},
57+
{
58+
"0000000000000000000000000000000006a217646dd7ce72eb0ecf0fe42b26d19261010afb633030a0ecd65388d6e76d96df34bd9a2182be81a7ac674d61158f"_hex,
59+
"00000000000000000000000000000000178f6a309845d6ec5b57dcc8874294d3ba18bc04af364f038597d680c18ae070e5ec056b83a762b407b4232e37459a16"_hex,
60+
},
61+
{
62+
"000000000000000000000000000000000ddd34ecdb7c52c453a9f33d691f38680b8c7d8539b1c123808b6fcd42d032d7cb49828b85d904dc9980c292d8ce06b0"_hex,
63+
"0000000000000000000000000000000011aabaa0a78e641433e5bcef78e88b4a68dd8a513ebe339d87d85fd6860b57c6efbd0a90c44851a18f87455d926b4861"_hex,
64+
},
65+
{
66+
"0000000000000000000000000000000004a815eb8606282028f5f7558f910948e905b447727f5d88c7c0b51c2510357a7b8012adb826fd8cb7bb9e384ca5a68a"_hex,
67+
"000000000000000000000000000000000cf73659de07444291a03aa69936bb9549acef9cb193d2ac7aed79db3517ef61b848c4623a971e2ddeb7a548aa34b9f6"_hex,
68+
},
69+
{
70+
"000000000000000000000000000000000a1f21645a31d991a4509cee86763dcd655af7fb1a6d04a9493e0244fa04eca099e63af149f71caf642472bc1761199f"_hex,
71+
"000000000000000000000000000000001790e866be5d24247231e49ebb6eeaccb791af09948c3928403121dbe6338af66bf330de78c6b56b92a1681721c8607f"_hex,
72+
},
73+
{
74+
"00000000000000000000000000000000094f6f4bb3a1a35036ddfe8d3bde859afe22066bb038079c6b67c5b4ba31bd6e472db7bb84b16adc90661afd5dba75e0"_hex,
75+
"000000000000000000000000000000000aab57295627e79773a94c81cd6b8fa9be5b7ef5533ed2d3b5edf693c4b2ca269f9ed8431112b01419ef02f119dd94f9"_hex,
76+
},
77+
{
78+
"0000000000000000000000000000000004f174170152492f64695d020f0ece14ee99d4a306eb8d30cd7357640e66f3e22153e98c7208e234a874c889b127e44f"_hex,
79+
"0000000000000000000000000000000002077eb3d39567e26934b9457f4ca1f761991992d85c26302cefa543424c5497b472cac33e94f6bdb03c99916013aee9"_hex,
80+
},
81+
{
82+
"0000000000000000000000000000000014e14fe19cd378a3351b764afc8c13b63d1bda36f3f261d53ae3bc189677d4f12ef388b195e9ae4edf630ee43fd5ad4d"_hex,
83+
"000000000000000000000000000000000de02bdcac42f674df16b61208bf8fec06abb73f725a0742dbf699b681bfa05168a865688bd6a7a3c0eda7ccd57f5202"_hex,
84+
}}};
85+
86+
87+
const PointsArrayType g2_test_points{{{"00000000000000000000000000000000113b300891bb9007cb40a8bb9e0"
88+
"5629b6e3bfa1eb5e67750e75dce2b8a67"
89+
"3572187705ae16e62daa55b224853d1d623b"
90+
"000000000000000000000000000000000331bd0b51374d6e580da7fd40f61af6b0e6458cbe07d9d2e74914a486dec84b544a874a264e93c4f320841dce129db8"_hex,
91+
"0000000000000000000000000000000007598231ae9c7943e6c03292"
92+
"e1aa8d61ff6110d28d0e80407de986059"
93+
"7be123c3b5343adca1e6b5ea96f9dfc41f6d772"
94+
"000000000000000000000000000000001954c40957a2a8d34cbe9c644691bde055af975ce327e4abd97da45dba983276d88395d5e0ae0806d65aacdefafe4749"_hex},
95+
{"0000000000000000000000000000000008b59a299a01cd2ef1fd625753b7c97e530a85938eb3171cd9c44615f"
96+
"42841f11684b69c483e03ea8972a85d348a146f"
97+
"0000000000000000000000000000000014db525c9e44adc16b99b5b78ac0fe7ba3af20358aeec9d783486a4fd4fa8a5efcdf929037ebbe1308e309e5d6b50dfe"_hex,
98+
"0000000000000000000000000000000010b467dbccf8b4f6ebd644967641122cd213501b435c2bc62d473e"
99+
"892e7fa99b8c1af77a8617f26f2e08df17a82f8cb8"
100+
"000000000000000000000000000000000b77070c4b9cc67975b26a368f0f14f2411ea81ba777034b09a524a5bc17479e436c890db4443e2e28a17879d202925e"_hex},
101+
{"0000000000000000000000000000000003e90e6c5e60ac33bd061282a5040ff6d3d4e1f4239c8e5c8d500e395"
102+
"3cd5f619e65e13ce9d9ca6f1f0cc4888234992c"
103+
"0000000000000000000000000000000006bad719a05061f7a54a346dd58edaaad5b4613db7f52b805cfc1586dcca354d61f4abee0e20b0955f521dc798cd7e00"_hex,
104+
"000000000000000000000000000000000f1802768a1bf9f8ebc188f732ce0ae7d23c629366df60a3d08e9e"
105+
"6d4c11b9d6d81b09876667d463eeb16810c70e7a1c"
106+
"0000000000000000000000000000000010c83fe489c77ae21ee823eb4d6a2ca5e7f0080ed186ec472e6253b69c6f9019650f2991eb9e05e590f7fb225a550573"_hex},
107+
{"000000000000000000000000000000000a7d777912b54412c493999d646f69309023b1c8a69012519c40b22af"
108+
"3debae2e046726263e999a76b6acacb0408a5a3"
109+
"0000000000000000000000000000000010ec46701a0843ce4435f0d991e9477e294aee25d7f2caf5db44b1ca21683909eb421aa8e07eeb0ab689d53e08bcaf69"_hex,
110+
"0000000000000000000000000000000009a2d76f1adf9042a6b02b6f3ff17f52e3897248e45996da3af0fb"
111+
"8b0945f7c2767229aa1ebb388e775f47b2f6f9ec7a"
112+
"0000000000000000000000000000000004f214fe1504929b04f5baf87ac95e4ef75275fd97916919c691130f8b723eba3084ffc11b3604552f40eaec0a8b0bdd"_hex},
113+
{"0000000000000000000000000000000019fc237c473e25469def1f455f1c939791037893b7debdc3d93315012"
114+
"1c8e499c70c361bdc6b34d1ab77b21ba6953341"
115+
"0000000000000000000000000000000001275d6ac87a6b3c0da206fa8871b431dafb7e75511951f05039eed30554b3b5647fe41429104431704e01ae05899844"_hex,
116+
"00000000000000000000000000000000103468609158d387794c08bd64b43d22be5c6d99841e674108b6d3"
117+
"84198e97bb37df40bd28036d9ac129c46af63d74cc"
118+
"00000000000000000000000000000000065420291f27a4da3c781f13bef9a8901fb6676afc0a993ad0d2527826d0134223291eba0d2674ad5bc99433b93414b2"_hex},
119+
{"000000000000000000000000000000000d5c2bec503b0615709a671ac54266ebbe9f75b6f8bbf0698349f0e21"
120+
"fde07747ee66d1d4841365fb72761803eee3f18"
121+
"0000000000000000000000000000000013124e27787729d0869c1386ec9671656d3894691eb6ca6a2193255a0f405edb63a2ec07bf8237f8999874a03b539222"_hex,
122+
"000000000000000000000000000000000368556ca1d34334be1d2a8f8063b5d6d9737207ff0e4f2aa722ea"
123+
"f0ce12ffdf7755fd8751617e08d05debaa64aa8995"
124+
"000000000000000000000000000000000fba5ca2cb230d450b5a091b4a3b2a4d8a29776697d0cb84609cb705bdcedff01043d0c2a4607f0fe8cf468dea631ba5"_hex},
125+
{"000000000000000000000000000000000c50453a39f252ce2e32973ebe69dde4fb3e2a9ac24de1376cffc8289"
126+
"a6a215800a99aaf2aecf97f134cb8ea6002dea9"
127+
"00000000000000000000000000000000018485f14e8e2987c9298f72cc5ce53d3529f789438453c0302218f4b77ffdc1185eb9a8724bb8e0d550f2ef4b5d1370"_hex,
128+
"000000000000000000000000000000001953407348ec087c91fc5745696282146a154c944f027121e66632"
129+
"97986bf7597825644145b481c7a53d0a624ad33a7d"
130+
"0000000000000000000000000000000011472eaad741eae3da87f0a4f7ec4dde77c199a9d8b549bf19f7c25244e211dbeb291889445bcbdf2b36d3f753eec282"_hex},
131+
{"0000000000000000000000000000000019fc237c473e25469def1f455f1c939791037893b7debdc3d93315012"
132+
"1c8e499c70c361bdc6b34d1ab77b21ba6953341"
133+
"0000000000000000000000000000000001275d6ac87a6b3c0da206fa8871b431dafb7e75511951f05039eed30554b3b5647fe41429104431704e01ae05899844"_hex,
134+
"00000000000000000000000000000000103468609158d387794c08bd64b43d22be5c6d99841e674108b6d3"
135+
"84198e97bb37df40bd28036d9ac129c46af63d74cc"
136+
"00000000000000000000000000000000065420291f27a4da3c781f13bef9a8901fb6676afc0a993ad0d2527826d0134223291eba0d2674ad5bc99433b93414b2"_hex},
137+
{"0000000000000000000000000000000008cf4f93e2806ef2630423d6bf5c9e0b9ed60bef6fe0ff0776b66fed0"
138+
"3f1e58822bad241e93725a5790803beb2830237"
139+
"0000000000000000000000000000000008ed0b1f59b0d3ecfda4778e038a16db110200054928fcfaa3fc93c7ea82cf75e294b61671afc41ab5d9313773d863c5"_hex,
140+
"0000000000000000000000000000000004770867fd6be78bb114bf41c0a8c5e9a52a8a969e7a23dc609705"
141+
"c3e9262167f7471cf1078c8708c9e50aae0750ec34"
142+
"000000000000000000000000000000000df0ec257b5ed7c8c344c8e18bf1b2b19c9deed84d2cd7d189c6bae6c4bec78945bc7c9f88101b5146e23fc8e96d5120"_hex},
143+
{"0000000000000000000000000000000008b0a8d57c2950ec115f3332361a5938af35ac01061ce7f9ad112d7ee"
144+
"e3a858e647ebef9392625d2886d114bb8b02465"
145+
"00000000000000000000000000000000031fcd4f4ce56194f9ac39b82c4133a0111772895769e8f8b8f5de4c61a88538928a9cfcf7ca2da51031cbd09ca4a90c"_hex,
146+
"00000000000000000000000000000000137a807ecef1af91a6d85bf4c85a705a77ece3b8354fd3ff50d46a"
147+
"db99e5299e6b6e8864e279311e05fd9ceed524e842"
148+
"0000000000000000000000000000000018e7d81a098e5b4c94f8b2cf644c8e9b3b99fe2ed99e25f9b797b34c0c497c56ce3283c2064311fe554d154939fac68d"_hex}}};
149+
150+
} // namespace
151+
152+
153+
[[nodiscard]] std::array<bytes, 5> generate_g1_mul_input(const intx::uint256& scalar) noexcept
154+
{
155+
return generate_mul_input(scalar, g1_test_points);
156+
}
157+
158+
[[nodiscard]] std::array<bytes, 5> generate_g2_mul_input(const intx::uint256& scalar) noexcept
159+
{
160+
return generate_mul_input(scalar, g2_test_points);
161+
}
162+
163+
[[nodiscard]] bytes generate_g1_msm_input(size_t num, const intx::uint256& scalar) noexcept
164+
{
165+
return generate_msm_input(num, scalar, g1_test_points);
166+
}
167+
168+
[[nodiscard]] bytes generate_g2_msm_input(size_t num, const intx::uint256& scalar) noexcept
169+
{
170+
return generate_msm_input(num, scalar, g2_test_points);
171+
}
172+
173+
} // namespace evmone::test
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// evmone: Fast Ethereum Virtual Machine implementation
2+
// Copyright 2019-2020 The evmone Authors.
3+
// SPDX-License-Identifier: Apache-2.0
4+
#pragma once
5+
6+
#include "evmc/evmc.hpp"
7+
#include "intx/intx.hpp"
8+
9+
namespace evmone::test
10+
{
11+
[[nodiscard]] std::array<evmc::bytes, 5> generate_g1_mul_input(
12+
const intx::uint256& scalar = std::numeric_limits<intx::uint256>::max()) noexcept;
13+
[[nodiscard]] std::array<evmc::bytes, 5> generate_g2_mul_input(
14+
const intx::uint256& scalar = std::numeric_limits<intx::uint256>::max()) noexcept;
15+
[[nodiscard]] evmc::bytes generate_g1_msm_input(
16+
size_t num, const intx::uint256& scalar = std::numeric_limits<intx::uint256>::max()) noexcept;
17+
[[nodiscard]] evmc::bytes generate_g2_msm_input(
18+
size_t num, const intx::uint256& scalar = std::numeric_limits<intx::uint256>::max()) noexcept;
19+
} // namespace evmone::test

test/precompiles_bench/precompiles_bench.cpp

+69-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
#include "../utils/utils.hpp"
6+
#include "bls_bench_input.hpp"
67
#include <benchmark/benchmark.h>
78
#include <state/precompiles.hpp>
89
#include <state/precompiles_internal.hpp>
@@ -35,6 +36,14 @@ template <>
3536
[[maybe_unused]] constexpr auto analyze<PrecompileId::ecpairing> = ecpairing_analyze;
3637
template <>
3738
constexpr auto analyze<PrecompileId::point_evaluation> = point_evaluation_analyze;
39+
template <>
40+
constexpr auto analyze<PrecompileId::bls12_g1mul> = bls12_g1mul_analyze;
41+
template <>
42+
constexpr auto analyze<PrecompileId::bls12_g1msm> = bls12_g1msm_analyze;
43+
template <>
44+
constexpr auto analyze<PrecompileId::bls12_g2mul> = bls12_g2mul_analyze;
45+
template <>
46+
constexpr auto analyze<PrecompileId::bls12_g2msm> = bls12_g2msm_analyze;
3847

3948
template <PrecompileId>
4049
const inline std::array inputs{0};
@@ -138,14 +147,28 @@ const inline std::array inputs<PrecompileId::point_evaluation>{
138147
"01ff83fbe4488061b695d9e4632e9ab23c5b9dfb046241fac921659c2e3b6a4e5e88a0c20ef27ae5dea6e83a748115df152b207362c022a43c8ebbfbec73ea2a2b38376a1de4ed9abd35175ac422af7df2c6ddf1503979964b1d217747c108978969cc0fcbd47dba8b1e3cbba16920f3fc694fadbf203b55aa66aaf138a38ace946a7ccddc20f45d796cd60268df8a2487d06c11cdc50247c580c5dd25f6fb486053b73868038cb92c2ae6d429a7bde850177f31c9fde00ca824c8c59cd4ef49"_hex,
139148
};
140149

150+
template <>
151+
const inline std::array inputs<PrecompileId::bls12_g1mul>{generate_g1_mul_input()};
152+
template <>
153+
const inline std::array inputs<PrecompileId::bls12_g2mul>{generate_g2_mul_input()};
154+
template <>
155+
const inline std::array inputs<PrecompileId::bls12_g1msm>{generate_g1_msm_input(256)};
156+
template <>
157+
const inline std::array inputs<PrecompileId::bls12_g2msm>{generate_g2_msm_input(256)};
158+
141159
template <PrecompileId Id, ExecuteFn Fn>
142160
void precompile(benchmark::State& state)
143161
{
144162
int64_t batch_gas_cost = 0;
145163
size_t max_output_size = 0;
146164
for (const auto& input : inputs<Id>)
147165
{
148-
const auto r = analyze<Id>(input, EVMC_LATEST_STABLE_REVISION);
166+
size_t input_size = input.size();
167+
if constexpr (Id == PrecompileId::bls12_g1msm)
168+
input_size = 160 * static_cast<size_t>(state.range(0));
169+
else if constexpr (Id == PrecompileId::bls12_g2msm)
170+
input_size = 288 * static_cast<size_t>(state.range(0));
171+
const auto r = analyze<Id>(input.substr(0, input_size), EVMC_LATEST_STABLE_REVISION);
149172
batch_gas_cost += r.gas_cost;
150173
max_output_size = std::max(max_output_size, r.max_output_size);
151174
}
@@ -157,7 +180,13 @@ void precompile(benchmark::State& state)
157180
{
158181
for (const auto& input : inputs<Id>)
159182
{
160-
const auto [status, _] = Fn(input.data(), input.size(), output.get(), max_output_size);
183+
size_t input_size = input.size();
184+
if constexpr (Id == PrecompileId::bls12_g1msm)
185+
input_size = 160 * static_cast<size_t>(state.range(0));
186+
else if constexpr (Id == PrecompileId::bls12_g2msm)
187+
input_size = 288 * static_cast<size_t>(state.range(0));
188+
189+
const auto [status, _] = Fn(input.data(), input_size, output.get(), max_output_size);
161190
if (status != EVMC_SUCCESS) [[unlikely]]
162191
{
163192
state.SkipWithError("invalid result");
@@ -170,17 +199,20 @@ void precompile(benchmark::State& state)
170199
using benchmark::Counter;
171200
state.counters["gas_used"] = Counter(static_cast<double>(batch_gas_cost));
172201
state.counters["gas_rate"] = Counter(static_cast<double>(total_gas_used), Counter::kIsRate);
202+
// state.SetComplexityN(state.range(0));
173203
}
174204

175205
BENCHMARK_TEMPLATE(precompile, PrecompileId::identity, identity_execute);
176206

177207
namespace bench_ecrecovery
178208
{
179209
constexpr auto evmmax_cpp = ecrecover_execute;
180-
BENCHMARK_TEMPLATE(precompile, PrecompileId::ecrecover, evmmax_cpp);
210+
BENCHMARK_TEMPLATE(precompile, PrecompileId::ecrecover, evmmax_cpp)
211+
->Unit(benchmark::TimeUnit::kMicrosecond);
181212
#ifdef EVMONE_PRECOMPILES_SILKPRE
182213
constexpr auto libsecp256k1 = silkpre_ecrecover_execute;
183-
BENCHMARK_TEMPLATE(precompile, PrecompileId::ecrecover, libsecp256k1);
214+
BENCHMARK_TEMPLATE(precompile, PrecompileId::ecrecover, libsecp256k1)
215+
->Unit(benchmark::TimeUnit::kMicrosecond);
184216
#endif
185217
} // namespace bench_ecrecovery
186218

@@ -218,6 +250,39 @@ constexpr auto evmone_blst = point_evaluation_execute;
218250
BENCHMARK_TEMPLATE(precompile, PrecompileId::point_evaluation, evmone_blst);
219251
} // namespace bench_kzg
220252

253+
namespace bench_mul_g1
254+
{
255+
constexpr auto evmone_blst = bls12_g1mul_execute;
256+
BENCHMARK_TEMPLATE(precompile, PrecompileId::bls12_g1mul, evmone_blst)
257+
->Unit(benchmark::TimeUnit::kMicrosecond);
258+
} // namespace bench_mul_g1
259+
260+
namespace bench_msm_g1
261+
{
262+
constexpr auto evmone_blst = bls12_g1msm_execute;
263+
BENCHMARK_TEMPLATE(precompile, PrecompileId::bls12_g1msm, evmone_blst)
264+
->DenseRange(1, 256)
265+
// ->Complexity(benchmark::oN)
266+
->Unit(benchmark::TimeUnit::kMicrosecond);
267+
} // namespace bench_msm_g1
268+
269+
namespace bench_mul_g2
270+
{
271+
constexpr auto evmone_blst = bls12_g2mul_execute;
272+
BENCHMARK_TEMPLATE(precompile, PrecompileId::bls12_g2mul, evmone_blst)
273+
// ->Complexity(benchmark::oN)
274+
->Unit(benchmark::TimeUnit::kMicrosecond);
275+
} // namespace bench_mul_g2
276+
277+
namespace bench_msm_g2
278+
{
279+
constexpr auto evmone_blst = bls12_g2msm_execute;
280+
BENCHMARK_TEMPLATE(precompile, PrecompileId::bls12_g2msm, evmone_blst)
281+
->DenseRange(1, 256)
282+
// ->Complexity(benchmark::oN)
283+
->Unit(benchmark::TimeUnit::kMicrosecond);
284+
} // namespace bench_msm_g2
285+
221286
} // namespace
222287

223288
BENCHMARK_MAIN();

0 commit comments

Comments
 (0)