Spin-off of #2006434: Speed up web tests.
There is zero reason to use drupal_static() for parsed info.yml files, they are manually edited files and don't change during the same request (and altering the info happens outside that function) and services.yml is currently not statically cached at all.
We clear the drupal static cache 3x during a single test run, using a static method for this means we save 2 of those parse runs and for every additional test method, we save all of them. As we parse *all* info files, not just those that we're going to enable, that means hundreds of saved .yml file parsing per test.
Similar for the services, core.services.yml and the few others are currently reparsed every time we enable a module. That's currently something like ~80 times (all .service.yml files combined). And unlike .info files, core.services.yml is *500* lines of yaml.
See also #1920902: Add a Drupal Yaml wrapper so we can default to PECL Yaml component if it is available, which aims to make yaml parsing itself faster. This and that issue complement each other, faster parsing is not reason to not avoid parsing when not necessary :)
Although this mostly helps testing, it should also speed up the installer and enabling multiple modules at once.
Note that the tesbots have way too much fluctuation to measure improvements based on a single run. But I've run the complete test suite locally and I've seen nice and consistent improvements.
Attachment | Size | Status | Test result | Operations |
---|---|---|---|---|
yaml-static-cache-2006434-4.patch | 1.57 KB | Idle | PASSED: [[SimpleTest]]: [MySQL] 58,117 pass(es). | View details | Re-test |