Skip to content

Commit 5a48ce8

Browse files
Use tmpfs for running benchmarks (#6966)
1 parent 7d72dfe commit 5a48ce8

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/osrm-backend.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -723,14 +723,34 @@ jobs:
723723
make -j$(nproc) benchmarks
724724
cd ..
725725
make -C test/data
726+
# we run benchmarks in tmpfs to avoid impact of disk IO
727+
- name: Create folder for tmpfs
728+
run: mkdir -p /opt/benchmarks
726729
- name: Run PR Benchmarks
727730
run: |
728-
./pr/scripts/ci/run_benchmarks.sh -f $(pwd)/pr -r $(pwd)/pr_results -s $(pwd)/pr -b $(pwd)/pr/build -o ~/data.osm.pbf -g ~/gps_traces.csv
731+
sudo mount -t tmpfs -o size=4g none /opt/benchmarks
732+
cp -rf pr/build /opt/benchmarks/build
733+
mkdir -p /opt/benchmarks/test
734+
cp -rf pr/test/data /opt/benchmarks/test/data
735+
cp -rf pr/profiles /opt/benchmarks/profiles
736+
737+
./pr/scripts/ci/run_benchmarks.sh -f /opt/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b /opt/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
738+
sudo umount /opt/benchmarks
729739
- name: Run Base Benchmarks
730740
run: |
741+
sudo mount -t tmpfs -o size=4g none /opt/benchmarks
742+
cp -rf base/build /opt/benchmarks/build
743+
mkdir -p /opt/benchmarks/test
744+
cp -rf base/test/data /opt/benchmarks/test/data
745+
cp -rf base/profiles /opt/benchmarks/profiles
746+
747+
# TODO: remove it when base branch will have this file at needed location
748+
if [ ! -f /opt/benchmarks/test/data/portugal_to_korea.json ]; then
749+
cp base/src/benchmarks/portugal_to_korea.json /opt/benchmarks/test/data/portugal_to_korea.json
750+
fi
731751
# we intentionally use scripts from PR branch to be able to update them and see results in the same PR
732-
./pr/scripts/ci/run_benchmarks.sh -f $(pwd)/base -r $(pwd)/base_results -s $(pwd)/pr -b $(pwd)/base/build -o ~/data.osm.pbf -g ~/gps_traces.csv
733-
752+
./pr/scripts/ci/run_benchmarks.sh -f /opt/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b /opt/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv
753+
sudo umount /opt/benchmarks
734754
- name: Post Benchmark Results
735755
run: |
736756
python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results

scripts/ci/run_benchmarks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function run_benchmarks_for_folder {
6464
echo "Running alias"
6565
$BENCHMARKS_FOLDER/alias-bench > "$RESULTS_FOLDER/alias.bench"
6666
echo "Running json-render-bench"
67-
$BENCHMARKS_FOLDER/json-render-bench "$FOLDER/src/benchmarks/portugal_to_korea.json" > "$RESULTS_FOLDER/json-render.bench"
67+
$BENCHMARKS_FOLDER/json-render-bench "$FOLDER/test/data/portugal_to_korea.json" > "$RESULTS_FOLDER/json-render.bench"
6868
echo "Running packedvector-bench"
6969
$BENCHMARKS_FOLDER/packedvector-bench > "$RESULTS_FOLDER/packedvector.bench"
7070
echo "Running rtree-bench"

0 commit comments

Comments
 (0)