- Issue created by @alexpott
- Status changed to Needs review
12 months ago 5:35pm 15 January 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
I can't find anything to complain about π€
- πΊπΈUnited States smustgrave
Question, is this a feature we should add test coverage for?
- π¬π§United Kingdom alexpott πͺπΊπ
@smustgrave I've added a test - it's not hard to add something small to a unit test for this.
- π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
One nit on the MR.
Should we do some profiling or benchmarking here? π€ I think it's not really necessary because this only happens in the cold cache scenario, per:
This means that library YAML files have to be re-read on a cache clear even when the files do not change. This is different from info.yml, service.yml and any of the plugin yaml files.
β¦ but it sure wouldn't hurt. We don't want to make the cold cache scenario more expensive/slower. But if anything, this should make it faster/cheaper.
- π¬π§United Kingdom alexpott πͺπΊπ
For the given code in test_script.php, Standard profile installed, on PHP 8.2 and APCu installed and enabled on CLI:
use Drupal\Component\Utility\Timer; $modules = array_keys(\Drupal::getContainer()->getParameter('container.modules')); foreach($modules as $module) { \Drupal::service('library.discovery.parser')->buildByExtension($module); } for ($i = 0; $i < 10; $i++) { drupal_flush_all_caches(); Timer::start('library.discovery.parser'); foreach($modules as $module) { \Drupal::service('library.discovery.parser')->buildByExtension($module); } Timer::stop('library.discovery.parser'); } $time = Timer::read('library.discovery.parser'); print "Library parsing completed in {$time}ms\n";
With MR using Symfony YAML
$ vendor/bin/drush scr test_script.php Library parsing completed in 63.54ms
Without patch using Symfony YAML
$ vendor/bin/drush scr test_script.php Library parsing completed in 117.06ms
Without patch and with PECL YAML installed
$ vendor/bin/drush scr test_script.php Library parsing completed in 75.47ms
- Status changed to RTBC
11 months ago 10:21am 19 January 2024 - π§πͺBelgium wim leers Ghent π§πͺπͺπΊ
Random failure in https://git.drupalcode.org/project/drupal/-/jobs/662217 because the MySQL DB went away, which made 4 unrelated kernel tests fail. I cannot retest this job π€·ββοΈ
#8 provides the numbers that remove any worries about cold cache scenarios π
- Status changed to Fixed
11 months ago 12:25pm 19 January 2024 Automatically closed - issue fixed for 2 weeks with no activity.