From cb8e274c073d05064987e10713af30508b60ecc7 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Tue, 18 Apr 2023 15:50:27 +0200 Subject: Speedup tests by caching HomeServerConfig instances (#15284) These two lines: ``` config_obj = HomeServerConfig() config_obj.parse_config_dict(config, "", "") ``` are called many times with the exact same value for `config`. As the test suite is CPU-bound and non-negligeably time is spent in `parse_config_dict`, this saves ~5% on the overall runtime of the Trial test suite (tested with both `-j2` and `-j12` on a 12t CPU). This is sadly rather limited, as the cache cannot be shared between processes (it contains at least jinja2.Template and RLock objects which aren't pickleable), and Trial tends to run close tests in different processes. --- changelog.d/15284.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/15284.misc (limited to 'changelog.d/15284.misc') diff --git a/changelog.d/15284.misc b/changelog.d/15284.misc new file mode 100644 index 0000000000..99d753f8f0 --- /dev/null +++ b/changelog.d/15284.misc @@ -0,0 +1 @@ +Speedup tests by caching HomeServerConfig instances. -- cgit 1.5.1