Skip to content

Changeset 48141 causes v5.5 to be 10x slower when compared to v5.4 #24893

@franccan

Description

@franccan

Describe the bug

The new version of WordPress (v5.5) makes close to a 100 fstat/stat calls. The older version only made about 10. This causes much higher load times.

To reproduce

$ cat wp54/wp-includes/version.php | grep '$wp_version ='
$wp_version = '5.4.2';
$ cat wp55/wp-includes/version.php | grep '$wp_version ='
$wp_version = '5.5';
$ cat /etc/php.d/10-opcache.ini | grep opcache.enable=
opcache.enable=1
$ for i in {1..10}; do curl -o /dev/null -s -w "%{time_starttransfer}\n" http://127.0.0.1/wp54/; done
0.026642
0.025308
0.028559
0.024185
0.025022
0.026277
0.034598
0.022461
0.034280
0.025716
$ for i in {1..10}; do curl -o /dev/null -s -w "%{time_starttransfer}\n" http://127.0.0.1/wp55/; done
0.219753
0.190224
0.188829
0.189912
0.181504
0.183236
0.189652
0.188126
0.207370
0.208778

Removing OPCache improves load times but still 2 times slower.

$ cat /etc/php.d/10-opcache.ini | grep opcache.enable=
opcache.enable=0
$ for i in {1..10}; do curl -o /dev/null -s -w "%{time_starttransfer}\n" http://127.0.0.1/wp55/; done
1.944018
1.415046
1.444394
1.391490
1.391182
1.385474
1.341410
1.325611
1.381883
1.397277
$ for i in {1..10}; do curl -o /dev/null -s -w "%{time_starttransfer}\n" http://127.0.0.1/wp54/; done
0.918116
0.659779
0.640934
0.618937
0.613510
0.641750
0.617641
0.608814
0.611889
0.649169

Expected behavior
Similar load times when comparing the latest version (v5.5) and the previous one (v5.4)

Screenshots
N/A

Editor version (please complete the following information):

  • WordPress version: 5.5
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default?
    default installation

Desktop (please complete the following information):
n/a

Smartphone (please complete the following information):
n/a

Additional context

######## NOTE ########

This setup is using shared storage behind a network.

This issue may not be noticeable if the server is using local hard disks.

########################

Trace included in a spreadsheet

– fstat/stat present when tracing v5.5 home page: 87
– fstat/stat present when tracing in v5.4 home page: 9
This seems to be related to many additional .json files being loaded in v5.5 which was not the case for v5.4. -> https://github.com/WordPress/WordPress/blob/master/wp-includes/blocks.php#L190

call were traced using strace

sudo strace -f $(pgrep php-fpm | paste -s | sed -e 's/\([0-9]\+\)/-p \1/g' -e 's/\t/ /g') -r

OPCache-Tracing-wp55-vs-wp54.xlsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions