Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@ jobs:

- name: Run phpunit tests
run: vendor/bin/phpunit --testsuite tests --colors=always --testdox

- name: Check that benchmarks run
run: vendor/bin/phpbench run --revs=1 --iterations=1 --stop-on-error --progress=none
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
vendor
.phpunit.result.cache
.phpbench
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,23 @@ $modification->setReplacement('bar');
$printer->addModification($modification);
$printer->print();
```

## Benchmarks

The [benchmarks](test/benchmarks) measure parsing and analysing of generated logs with [phpbench](https://github.com/phpbench/phpbench).
They are meant to compare a change against `master` locally, CI only checks that they still run.

```
composer bench
```

To compare a branch against `master`, store a baseline on `master` and reference it on the branch:

```
git switch master
composer bench -- --tag=master
git switch my-branch
composer bench -- --ref=master
```

Disable Xdebug (`XDEBUG_MODE=off`) and keep the same PHP and opcache settings for both runs, otherwise the numbers are not comparable.
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"php": ">=8.4"
},
"require-dev": {
"phpunit/phpunit": "^12"
"phpunit/phpunit": "^12",
"phpbench/phpbench": "^1.7"
},
"autoload": {
"psr-4": {
Expand All @@ -23,10 +24,15 @@
"autoload-dev": {
"psr-4": {
"Aternos\\Codex\\Test\\Src\\": "test/src/",
"Aternos\\Codex\\Test\\Tests\\": "test/tests/"
}
"Aternos\\Codex\\Test\\Tests\\": "test/tests/",
"Aternos\\Codex\\Test\\Benchmarks\\": "test/benchmarks/"
},
"classmap": [
"test/benchmarks/Insight/KeywordProblems.php"
]
},
"scripts": {
"test": "phpunit test/tests"
"test": "phpunit test/tests",
"bench": "phpbench run --report=default"
}
}
Loading
Loading