From b6ef6065d490639aff0233b8f612bdda1a1c55e6 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:29:58 +0100 Subject: [PATCH 01/15] phpbench: added composer scripts for recording/comparing a baseline --- .gitignore | 1 + composer.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index f31ad28..04b86eb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .idea/ .private/ .php_cs.cache +.phpbench/ .phpunit.result.cache Gherkin infection.log diff --git a/composer.json b/composer.json index 8c1e807..f572c3f 100644 --- a/composer.json +++ b/composer.json @@ -63,6 +63,8 @@ "phpunit": "vendor/bin/phpunit", "psalm": "vendor/bin/psalm", "uptodocs": "docs/testdocs", + "benchmark-baseline": "phpbench run benchmarks --report=aggregate --tag=original --retry-threshold=5", + "benchmark-compare-baseline": "phpbench run benchmarks --report=aggregate --ref=original --retry-threshold=5", "benchmark": "phpbench run benchmarks --report=aggregate" } } From ba4ecb57b065d4d7926786d2c9e63a741bfd2577 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:32:38 +0100 Subject: [PATCH 02/15] github-actions: added benchmark workflow --- .github/workflows/benchmark.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000..628aeb0 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,24 @@ +name: Tests + +on: [pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + ref: main + + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + + - name: create a perf baseline + run: composer benchmark-baseline + + - uses: actions/checkout@v2 + + - name: compare PR against a perf baseline + run: composer benchmark-compare-baseline From 42f64cb4c34bfe98982ef02ac481ed35b33e983d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:33:46 +0100 Subject: [PATCH 03/15] fix typo --- .github/workflows/benchmark.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 628aeb0..86bc888 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,6 +1,6 @@ -name: Tests +name: Benchmark -on: [pull_request] +on: [push, pull_request] jobs: build: From 25fc42ad88fa52e8e4abbf4f153f65130a35857d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:37:01 +0100 Subject: [PATCH 04/15] Update benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 86bc888..b27e8a6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: main + ref: b6ef606 # todo change to "main" - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest From 591c46a020e58c53af83cf762da17d943c8d7fae Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:40:44 +0100 Subject: [PATCH 05/15] Update benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b27e8a6..482972e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: b6ef606 # todo change to "main" + ref: 'b6ef6065d490639aff0233b8f612bdda1a1c55e6' # todo change to "main" - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest From fcb698b7833ec0fce26d46cae15cfb7efb369417 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:43:59 +0100 Subject: [PATCH 06/15] Update benchmark.yml --- .github/workflows/benchmark.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 482972e..03a78b6 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -8,6 +8,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + - uses: actions/checkout@v2 with: ref: 'b6ef6065d490639aff0233b8f612bdda1a1c55e6' # todo change to "main" From cb01e9424f8f69afd8b39c3e9416422d9fc52a80 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:45:30 +0100 Subject: [PATCH 07/15] Update benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 03a78b6..ca2ee47 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -5,7 +5,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Setup PHP From d6baacca68ebd042bfc52f6e8f4a5a87a38f635e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:46:08 +0100 Subject: [PATCH 08/15] Update benchmark.yml --- .github/workflows/benchmark.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index ca2ee47..526cc6a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -25,5 +25,8 @@ jobs: - uses: actions/checkout@v2 + - name: Install dependencies + run: composer install --prefer-dist --no-progress --no-suggest + - name: compare PR against a perf baseline run: composer benchmark-compare-baseline From e133da2435d2674e807d6d40d5584ab9e5d36088 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 14:52:00 +0100 Subject: [PATCH 09/15] use /tmp storage path --- .github/workflows/benchmark.yml | 4 +++- phpbench.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 526cc6a..5dcbe2e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -13,6 +13,7 @@ jobs: with: php-version: '7.4' + # create baseline - uses: actions/checkout@v2 with: ref: 'b6ef6065d490639aff0233b8f612bdda1a1c55e6' # todo change to "main" @@ -23,10 +24,11 @@ jobs: - name: create a perf baseline run: composer benchmark-baseline + # compare against current commit - uses: actions/checkout@v2 - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest - + - name: compare PR against a perf baseline run: composer benchmark-compare-baseline diff --git a/phpbench.json b/phpbench.json index 355f124..66d6a41 100644 --- a/phpbench.json +++ b/phpbench.json @@ -1,3 +1,4 @@ { - "bootstrap": "vendor/autoload.php" + "bootstrap": "vendor/autoload.php", + "xml_storage_path": "/tmp" } From 0635aaeb5e85dfae1b628286f3f738e6e09ba1ed Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 16:56:28 +0100 Subject: [PATCH 10/15] Update .github/workflows/benchmark.yml --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5dcbe2e..b2a4723 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -16,7 +16,7 @@ jobs: # create baseline - uses: actions/checkout@v2 with: - ref: 'b6ef6065d490639aff0233b8f612bdda1a1c55e6' # todo change to "main" + ref: 'e133da2435d2674e807d6d40d5584ab9e5d36088' # todo change to "main" - name: Install dependencies run: composer install --prefer-dist --no-progress --no-suggest From 602101c177da853e322c3d86623a622a7a43190b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 18:06:31 +0100 Subject: [PATCH 11/15] Update phpbench.json --- phpbench.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpbench.json b/phpbench.json index 66d6a41..a948fbe 100644 --- a/phpbench.json +++ b/phpbench.json @@ -1,4 +1,4 @@ { "bootstrap": "vendor/autoload.php", - "xml_storage_path": "/tmp" + "xml_storage_path": "/tmp/.phpbench/storage" } From f8d418152ff9be58b0320199a958e897cf36e89d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 20:09:40 +0100 Subject: [PATCH 12/15] Delete benchmark.yml --- .github/workflows/benchmark.yml | 34 --------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 .github/workflows/benchmark.yml diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index b2a4723..0000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Benchmark - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-20.04 - - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - - # create baseline - - uses: actions/checkout@v2 - with: - ref: 'e133da2435d2674e807d6d40d5584ab9e5d36088' # todo change to "main" - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - - name: create a perf baseline - run: composer benchmark-baseline - - # compare against current commit - - uses: actions/checkout@v2 - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - - name: compare PR against a perf baseline - run: composer benchmark-compare-baseline From f6c0f497d6de55fe0232ad0c98dacab775cbfb06 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 14 Mar 2021 20:11:53 +0100 Subject: [PATCH 13/15] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 04b86eb..f31ad28 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ .idea/ .private/ .php_cs.cache -.phpbench/ .phpunit.result.cache Gherkin infection.log From 0359c944f838d212fed88053df87df2742afca6e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 15 Mar 2021 14:27:26 +0100 Subject: [PATCH 14/15] Update phpbench.json --- phpbench.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpbench.json b/phpbench.json index a948fbe..355f124 100644 --- a/phpbench.json +++ b/phpbench.json @@ -1,4 +1,3 @@ { - "bootstrap": "vendor/autoload.php", - "xml_storage_path": "/tmp/.phpbench/storage" + "bootstrap": "vendor/autoload.php" } From 4328a64e1fe9d4c8e7f0aac1b3c66b6f85f286bf Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 15 Mar 2021 14:27:48 +0100 Subject: [PATCH 15/15] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f31ad28..35c6d36 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .private/ .php_cs.cache .phpunit.result.cache +.phpbench/ Gherkin infection.log per-mutator.md