Convert performance tests to PHPBench#248
Conversation
| - stage: Benchmark | ||
| install: | ||
| - travis_retry composer update --prefer-dist | ||
| - curl -o phpbench.phar https://phpbench.github.io/phpbench/phpbench.phar |
There was a problem hiding this comment.
I know I'm a weirdo, but I'd rather composer require with a specific version here. I don't consider curl to be a good way to install things...
There was a problem hiding this comment.
I'd too, but it's not possible, as said above:
It's not possible to have phpbench/phpbench as dev-dependency due to back-reference to doctrine/annotations 1.x.
Also curling specific version is currently not possible as versioned PHARs are not published (already discussed with @dantleech to be possible in future).
There was a problem hiding this comment.
Otherwise a phar could be downloaded with phive, but I had a few issues with travis in the past.
There was a problem hiding this comment.
Still same issues: would need to be in the dependency graph. Let's tackle the problem once we hit 2.0.0 (stable) then, and a dependency loop can be re-introduced, if needed.
| "Doctrine\\Tests\\Annotations\\": "tests/Doctrine/Tests/Annotations" | ||
| }, | ||
| "files": [ | ||
| "tests/Doctrine/Tests/Annotations/Fixtures/SingleClassLOC1000.php" |
There was a problem hiding this comment.
Does this need to be in classmap?
There was a problem hiding this comment.
It's an unnamespaced class that was loaded using require_once previously.
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "bootstrap": "vendor/autoload.php", | |||
There was a problem hiding this comment.
Possibly not needed if we use a vendor version of the CLI
|
|
||
| public function initialize() : void | ||
| { | ||
| $this->reader = new CachedReader(new AnnotationReader(), new ArrayCache()); |
There was a problem hiding this comment.
Should probably use a void cache in this sort of test. Also clashes with CachedReader removal - maybe take the chance and get rid of it overall?
Ocramius
left a comment
There was a problem hiding this comment.
🚢
Note that this should hit a 1.x release before we push for 2.x, as otherwise we don't know if we're making things better or worse.
Instead of testing perf with PHPUnit and printing some fancy output, we can use PHPBench instead.
It's not possible to have phpbench/phpbench as dev-dependency due to back-reference to doctrine/annotations 1.x.
I don't have much experience with writing PHPBench suites yet so suggestions are welcomed. :)