Skip to content

Commit 91f6e75

Browse files
authored
Add ethereumjs build (#205)
* Add support for Besu benchmark * Add ethereumjs build
1 parent af406a4 commit 91f6e75

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/instrumentation_measurement/measurements.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
DEFAULT_EXEC_NETHERMIND = '../../../gas-cost-estimator-clients/build/nethermind/Nethermind.Benchmark.Runner'
1919
DEFAULT_EXEC_ERIGON = '../../../gas-cost-estimator-clients/build/erigon/evm'
2020
DEFAULT_EXEC_REVM = '../../../gas-cost-estimator-clients/build/revm/revme'
21-
DEFAULT_EXEC_ETHERJS = '../../../gas-cost-estimator-clients/ethereumjs-monorepo/packages/vm/benchmarks/run.js'
21+
DEFAULT_EXEC_ETHERJS = '../../../gas-cost-estimator-clients/build/ethereumjs/index.js'
2222
DEFAULT_EXEC_BESU = '../../../gas-cost-estimator-clients/build/besu/evmtool/bin/evmtool'
2323

2424

@@ -111,11 +111,7 @@ def measure(self, sample_size=1, evm="evmone", input_file="", exec_path=""):
111111
header = "program_id,sample_id,total_time_ns,iterations_count"
112112
elif evm == nethermind:
113113
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns,mem_allocs,mem_alloc_bytes"
114-
elif evm == ethereumjs:
115-
header = "program_id,sample_id,total_time_ns,iterations_count,margin_of_error"
116-
elif evm == revm:
117-
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
118-
elif evm == besu:
114+
elif evm == ethereumjs or evm == revm or evm == besu:
119115
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
120116
print(header)
121117

@@ -295,8 +291,14 @@ def run_ethereumjs_benchmark(self, program, sample_size, exec_path):
295291
line_id = 1
296292
for line in raw_result:
297293
line_values = line.split(',')
294+
295+
if line_values[4].startswith('±') and line_values[4].endswith('%'):
296+
std_dev_ns = (float(line_values[4][1:-1]) * float(line_values[3])) / 100
297+
else :
298+
std_dev_ns = line_values[4]
299+
298300
instrumenter_result.append(
299-
f'{line_id},{line_values[3]},{line_values[5]},{line_values[4]}')
301+
f'{line_id},{line_values[3]},{line_values[5]},{std_dev_ns}')
300302
line_id += 1
301303
return instrumenter_result
302304

src/instrumentation_measurement/setup_clients.sh

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ if [ ! -d "ethereumjs-monorepo" ]; then
4545
npm i
4646
cd packages/vm
4747
npm run build:benchmarks
48+
ncc build benchmarks/run.js -o ../../../build/ethereumjs/
4849
cd ../../..
4950
fi
5051

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# install .NET 7.0
22
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
33
chmod +x ./dotnet-install.sh
4-
./dotnet-install.sh --channel 7.0
4+
sudo ./dotnet-install.sh --channel 7.0
55
rm ./dotnet-install.sh
66

77
# install go
88
sudo snap install go --classic
99

1010
# install rust
11-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
12-
11+
sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
1312

13+
# install node
14+
sudo curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
15+
sudo nvm install 20
16+
node -v
17+
npm -v
18+
sudo npm i -g @vercel/ncc

0 commit comments

Comments
 (0)