[wp-trac] [WordPress Trac] #63026: Investigate potential performance regressions when using PHP 8.4

WordPress Trac noreply at wordpress.org
Fri Feb 28 12:14:14 UTC 2025


#63026: Investigate potential performance regressions when using PHP 8.4
---------------------------+--------------------------
 Reporter:  desrosj        |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  6.8
Component:  Database       |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  needs-testing  |     Focuses:  performance
---------------------------+--------------------------
Changes (by johnbillion):

 * keywords:  needs-testing has-patch => needs-testing


Comment:

 Ok the culprit is indeed the commit that introduced the switch to bcrypt.
 The run time for the PHP 8.4 unit test jobs on GitHub Actions jumped from
 around 7-8 minutes to around 14-15.

 Some notes:

 * The unit tests for all PHP versions, not just 8.4, have slowed. The
 impact on 8.4 is the greatest, presumably due to the higher bcrypt cost.
 * Prior to the commit I had run several rounds of before and after
 performance tests of the test suite locally, however I was only doing this
 with the `--group auth` filter. The difference is less noticeable when
 only testing a subset, and there was an expected increase in the test time
 anyway due to an increase in the number of tests and the fact they make
 heavy use of the password hashing and checking functions.
 * The root cause is likely due to the high number of tests that make use
 of user fixtures. Each time a user fixture is created, a hash of their
 password is generated, which was previously handled by phpass but is now
 handled buy bcrypt which, by design, is slower.
 * Ideally any tests that need a user fixture but don't care about the
 user's password would bypass the password hashing, but that will require
 adjustments to tests relating to authentication.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63026#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list