summary refs log tree commit diff
path: root/changelog.d
diff options
context:
space:
mode:
authorVal Lorentz <progval+git+matrix@progval.net>2023-04-18 15:50:27 +0200
committerGitHub <noreply@github.com>2023-04-18 13:50:27 +0000
commitcb8e274c073d05064987e10713af30508b60ecc7 (patch)
treea82ebc8e25ef37f680e5b8a523beace915526122 /changelog.d
parentMove Spam Checker callbacks to a dedicated file (#15453) (diff)
downloadsynapse-cb8e274c073d05064987e10713af30508b60ecc7.tar.xz
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.
Diffstat (limited to 'changelog.d')
-rw-r--r--changelog.d/15284.misc1
1 files changed, 1 insertions, 0 deletions
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.