-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
I have some questions regarding the PHPUnit cache.
First of all: when does one benefit from it?
The only piece of documentation I can find about it is this:
Configure a directory where the PHPUnit test runner can cache data such as test results (required for reordering tests based on previous failures, for instance) or information about tested code as well as test code generated using static analysis (significantly improves performance of code coverage analysis, for instance).
What I understand:
- if you use the
defectsorder type, it will use it. By default it usesdefault, which unfortunately is not documented. At least here it is listed, but it does not say what it does, so you do not know if by default it is used or not. - Static analysis of some sorts may use it. Now, I know it is third-party so hard to have a reliable list, but maybe it would be good have a few listed? Personally I have no idea which kind uses it, and when.
Performance
Having a brief look at the cache directly, that is a lot of files. On Infection it is about 850 of them. I do not know if there is any extra cost for generating the cache, but I can only assume there's bound to be a cost for at least writing that many files.
I have no idea of the performance cost, I could not notice it on a naive benchmark I did with hyperfine.
That being said, if seems like a wasteful operation and if it proves to have a cost, would it make sense to have an option to disable it in the CI?