Skip to content

Commit

Permalink
Add support for Besu benchmark (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
JacekGlen authored Oct 18, 2024
1 parent 879c0fa commit af406a4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/instrumentation_measurement/measurements.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
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_BESU = '../../../gas-cost-estimator-clients/besu/ethereum/evmtool/build/install/evmtool/bin/evmtool'
DEFAULT_EXEC_BESU = '../../../gas-cost-estimator-clients/build/besu/evmtool/bin/evmtool'


class Program(object):
Expand Down Expand Up @@ -116,7 +116,7 @@ def measure(self, sample_size=1, evm="evmone", input_file="", exec_path=""):
elif evm == revm:
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
elif evm == besu:
header = "program_id,sample_id,total_time_ns"
header = "program_id,sample_id,total_time_ns,iterations_count,std_dev_time_ns"
print(header)

for program in self._programs:
Expand Down Expand Up @@ -372,7 +372,8 @@ def run_besu_benchmark(self, program, sample_size, exec_path):
return

result = json.loads(stdout)
results.append(str(run_id) + "," + str(result["timens"]))
results.append(
f'{run_id},{str(result["timens"])},{10*100},{str(result["std_dev_timens"])}')
return results

def csv_row_append_info(self, instrumenter_result, program):
Expand Down
7 changes: 6 additions & 1 deletion src/instrumentation_measurement/setup_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,10 @@ if [ ! -d "revm" ]; then
fi

if [ ! -d "besu" ]; then
git clone -b benchmarking https://github.com/imapp-pl/besu.git --depth 1
mkdir -p build/besu
git clone -b evmtoolAddSamplesOption https://github.com/lukasz-glen/besu.git --depth 1
cd besu
./gradlew :ethereum:evmTool:installDist
cp -fr ethereum/evmtool/build/install/evmtool ../build/besu/
cd ..
fi

0 comments on commit af406a4

Please sign in to comment.