Problem/Motivation

Part of the automated tests for the Thunder distribution is performance regression tests. We test various editorial tasks by executing them as Nightwatch tests and sending time markers to an Elastic APM stack at various stages of the task.

We then run those tests multiple times for different branches of the distribution and compare the results. Two branches we always test are a branch with the current Drupal version (Drupal 8.8.1 as of now) and another one with the latest version of the previous Drupal minor version (which is currently Drupal 8.7.11).

The test that measures the time between clicking on the "Save" button on a node edit form and the fully-loaded target page has seen a noticeable regression between Drupal 8.7 and 8.8.

This is a visualization of multiple test runs

The yellow line represents Drupal 8.7, the green one 8.8.
The average time suggests, that Drupal 8.8 takes about 15% longer to execute the node save.

It has to be said, that those tests are not run with Vanilla Drupal, we will provide easier reproducible tests later. But we wanted to get this getting started now.

Some things to consider

  • Each test run is executed on a fresh Thunder installation with 4500 nodes pre-generated.
  • The full test, that this save is part of, opens one of those nodes, changes all fields in it and then saves the node.
  • The content-type used in this test has several additional fields defined, one of these is a paragraph field, also metatags module is used. Both are known to slow down the save in general. Paragraphs module and metatags module versions are the same on both branches

Proposed resolution

Remaining tasks

  • Provide better reproducible test.
  • Investigate.

Comments

daniel.bosen created an issue. See original summary.

daniel.bosen’s picture

Issue summary: View changes
daniel.bosen’s picture

Issue summary: View changes
wim leers’s picture

Are you also observing performance differences when just viewing e.g. article pages when the cache is cold? (Page Cache, Dynamic Page Cache, Render Cache, any or all of these.)

Because the report here is not about the saving itself per se, it's possible that this is a regression solely on the rendering side.

wim leers’s picture

Also: what is being measured exactly? It sounds like it's the window.onload event. It'd be helpful to know if the server response time has changed (implying it's a server side performance regression), or if it's entirely a front end matter (client side performance regression).

daniel.bosen’s picture

StatusFileSize
new64.11 KB

We do not have data for the node view, but for the form load of the edit form. There is no big difference in 8.8 to 8.7.

daniel.bosen’s picture

Regarding #5 we are still improving the test, and try to get better results. Currently we measure the time from "Click save button" to "content list is visible on admin/content page".
So currently it is uncertain, where the time actually lost. Working on it :-)

wim leers’s picture

Awesome :)

And to be clear: I'm super grateful that you have this infrastructure set up and are taking the time to report back! 🥳

hchonov’s picture

Component: node system » entity system

Amazing. It would be great if we have some setup like this for core as well :). I think this most probably belongs in the entity system.

@daniel.bosen, could you please name the core modules you are using? Do you use any module relying on forward revisions like content_moderation or workspaces? Are they enabled for the node entity type in your tests?

daniel.bosen’s picture

StatusFileSize
new83.14 KB

Further investigations seem to indicate, that the real culprit is loading the content list after the save.
This is a graph of the durations for server-side loading of the content list, so no save post request and no rendering of the content list. The absolute time difference is very similar to the time difference of the whole process.

The times are taken from the browser measurement of requests, not within PHP.

daniel.bosen’s picture

@hchonov we disabled content moderation for this and do not use workspaces. We also disabled the custom view we usually use for admin/content.

daniel.bosen’s picture

AndyThornton’s picture

Sorry, no fancy graphs here (nice work!), but, yeah, we think we've seen a slow down too. We have some smoke tests that generate product pages and add layout builder blocks and we've had to tweak the 'sleeps' to be a bit longer. Does seem to be relatively margin but appreciable.

hchonov’s picture

I don't know how to proceed here. The best would be to narrow it down to a specific commit, but I don't know if this could be automated.

@daniel.bosen, maybe you could randomly pick some commits and check when the performance regression started occurring.

daniel.bosen’s picture

We were occupied with other things in the last few weeks, but I will continue investigating this now. First I try to git bisect the problem, as @hchonov suggested.

alexpott’s picture

Here's the first sub issue to address performance regressions in 8.8.x - see #3131585: Performance regression caused by using the last installed entity definitions

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

andypost’s picture

Version: 9.1.x-dev » 8.9.x-dev

Proper branch

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Bug Smash Initiative

Has this been solved by the commit of the single child issue, #3131585: Performance regression caused by using the last installed entity definitions?

If we don't receive additional information to help with the issue, it may be closed after three months.

Thanks!

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Since there has not been a follow up going to close this one out. If still an issue in D11 please reopen.