Spin-off of #2006434: [meta] 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.

CommentFileSizeAuthor
yaml-static-cache-2006434-4.patch1.57 KBBerdir
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
Anonymous’s picture

Status: Needs review » Reviewed & tested by the community

nice work.

Berdir’s picture

Looks like we actually got a relatively stable bot here. The last three core test runs of this one (#659) were 1h11, 1h12 and 1h13, this test took 1h6. So not a huge improvement that gets us back to where we were but still ~6 min saved, which is ~9%.

Wim Leers’s picture

9% is *a lot*!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed c6ebde4 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.