Skip to content

Commit

Permalink
Add ethereumjs build (#205)
Browse files Browse the repository at this point in the history
* Add support for Besu benchmark

* Add ethereumjs build
  • Loading branch information
JacekGlen authored Oct 18, 2024
1 parent af406a4 commit 91f6e75
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 9 additions & 7 deletions src/instrumentation_measurement/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
DEFAULT_EXEC_NETHERMIND = '../../../gas-cost-estimator-clients/build/nethermind/Nethermind.Benchmark.Runner'
DEFAULT_EXEC_ERIGON = '../../../gas-cost-estimator-clients/build/erigon/evm'
DEFAULT_EXEC_REVM = '../../../gas-cost-estimator-clients/build/revm/revme'
DEFAULT_EXEC_ETHERJS = '../../../gas-cost-estimator-clients/ethereumjs-monorepo/packages/vm/benchmarks/run.js'
DEFAULT_EXEC_ETHERJS = '../../../gas-cost-estimator-clients/build/ethereumjs/index.js'
DEFAULT_EXEC_BESU = '../../../gas-cost-estimator-clients/build/besu/evmtool/bin/evmtool'


Expand Down Expand Up @@ -111,11 +111,7 @@ def measure(self, sample_size=1, evm="evmone", input_file="", exec_path=""):
header = "program_id,sample_id,total_time_ns,iterations_count"
elif evm == nethermind:
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns,mem_allocs,mem_alloc_bytes"
elif evm == ethereumjs:
header = "program_id,sample_id,total_time_ns,iterations_count,margin_of_error"
elif evm == revm:
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
elif evm == besu:
elif evm == ethereumjs or evm == revm or evm == besu:
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
print(header)

Expand Down Expand Up @@ -295,8 +291,14 @@ def run_ethereumjs_benchmark(self, program, sample_size, exec_path):
line_id = 1
for line in raw_result:
line_values = line.split(',')

if line_values[4].startswith('±') and line_values[4].endswith('%'):
std_dev_ns = (float(line_values[4][1:-1]) * float(line_values[3])) / 100
else :
std_dev_ns = line_values[4]

instrumenter_result.append(
f'{line_id},{line_values[3]},{line_values[5]},{line_values[4]}')
f'{line_id},{line_values[3]},{line_values[5]},{std_dev_ns}')
line_id += 1
return instrumenter_result

Expand Down
1 change: 1 addition & 0 deletions src/instrumentation_measurement/setup_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if [ ! -d "ethereumjs-monorepo" ]; then
npm i
cd packages/vm
npm run build:benchmarks
ncc build benchmarks/run.js -o ../../../build/ethereumjs/
cd ../../..
fi

Expand Down
11 changes: 8 additions & 3 deletions src/instrumentation_measurement/setup_tools.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# install .NET 7.0
wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh
chmod +x ./dotnet-install.sh
./dotnet-install.sh --channel 7.0
sudo ./dotnet-install.sh --channel 7.0
rm ./dotnet-install.sh

# install go
sudo snap install go --classic

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

sudo curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

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

0 comments on commit 91f6e75

Please sign in to comment.