Commit graph

3 commits

Author SHA1 Message Date
Tim Starling
5e30a927bc tests: Make some PHPUnit data providers static
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.

Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.

Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
2023-03-24 02:53:57 +00:00
Tim Starling
6e40c79954 Config builder optimisations (combined)
This is a modified rebase of a patch by Tim,
see I75f405930a7b14561389c59d147640e870146bec.

Some benchmark results (from my laptop):

Loading defaults from config-schema.php:
  - Master:              115/sec ( 8.7ms)
  - I75f4059: (Tim):     575/sec ( 1.7ms)
  - Id9dd0bf: (Daniel): 1120/sec ( 0.9ms)
  - This (Tim+Daniel):  1420/sec ( 0.7ms)

Loading defaults and merging settings (worst case):
  - Master:               80/sec (12.4ms)
  - I75f4059: (Tim):      93/sec (10.8ms)
  - Id9dd0bf: (Daniel):  200/sec ( 4.9ms)
  - This (Tim+Daniel):   682/sec ( 1.5ms)

Original commit message by Tim:

* Explicitly import function array_key_exists to activate the special
  opcode
* Batch creation of MergeStrategy objects
* Batch default assignment to ArrayConfigBuilder

The batches mostly help by allowing more inlining, eliminating some
function calls.

Reduced time for apply/finalize benchmark from 540µs to 170µs.

Co-Authored-By: Tim Starling <tstarling@wikimedia.org>
Change-Id: I3d4dd685eaaa4351801b3bac6ce1592eea925c5f
2022-05-06 11:28:15 +02:00
daniel
33a3c3c687 Allow LocalSettings.php to be loaded in function scope.
This adds an experimental mode that loads LocalSettings.php in a
function, rather than in top level global scope. This is controlled
using the MW_USE_LOCAL_SETTINGS_LOADER environment variable.

This is not intended for use in production as this time.
The experimental mode should be available in the 1.38 release,
so people can try it out with different setups.

Bug: T304183
Depends-On: Ie6245ff8cd2bc7bab2af3b1450070185dbc2d824
Change-Id: I0f20024803336064ecb07b51fa56581af7b67a85
2022-03-28 14:10:42 +00:00