Skip to content

Commit

Permalink
Refactor benchmark setup and enhance CSV generation logging
Browse files Browse the repository at this point in the history
This refactor splits the benchmark setup into two separate jobs for better handling of individual configurations: one for Docker-based benchmarks and another for PHP-based benchmarks. The jobs now support testing with varying numbers of columns. In addition, the CSV generation process now includes better-riched logs for easier debugging.
  • Loading branch information
SmetDenis committed Mar 29, 2024
1 parent 616337a commit 4d14d35
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 6 deletions.
40 changes: 37 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ on:
- 'master'

jobs:
stress-test:
name: Benchmark
docker-benchmark:
name: via Docker
runs-on: ubuntu-latest
strategy:
matrix:
columns: [ 1, 5, 10, 20 ]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -46,5 +49,36 @@ jobs:
push: false
tags: jbzoo/csv-blueprint:local

- name: 🔥 Benchmark with Docker 🔥
- name: 🔥 Benchmark 🔥
run: make bench-docker --no-print-directory


php-benchmark:
name: via PHP
runs-on: ubuntu-latest
strategy:
matrix:
columns: [ 1, 5, 10, 20 ]
env:
BENCH_COLS: ${{ matrix.php-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
ini-values: opcache.enable_cli=1, opcache.jit=1255

- name: Build project
run: make build --no-print-directory

- name: Create random huge CSV files
run: make bench-create-csv --no-print-directory

- name: 🔥 Benchmark 🔥
run: make bench-php --no-print-directory
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,12 @@ BENCH_SCHEMAS := --schema='./tests/Benchmarks/benchmark-*.yml'
BENCH_FLAGS := --debug --profile --report=text -vvv


bench-all: ##@Benchmarks Run all benchmarks
bench: ##@Benchmarks Run all benchmarks
@make bench-create-csv
@make docker-build
@make bench-docker

bench-create-csv: ##@Benchmarks Create CSV file
$(call title,"Benchmark - Create CSV file")
$(call title,"Benchmark - Create CSV file. Cols=${BENCH_COLS} Rows=${BENCH_ROWS_SRC}_000")
@mkdir -pv ./build/bench/
@rm -fv ./build/bench/*.csv
@time bash ./tests/Benchmarks/create-csv.sh
Expand Down

0 comments on commit 4d14d35

Please sign in to comment.