diff options
author | Val Lorentz <progval+git+matrix@progval.net> | 2023-04-18 15:50:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-18 13:50:27 +0000 |
commit | cb8e274c073d05064987e10713af30508b60ecc7 (patch) | |
tree | a82ebc8e25ef37f680e5b8a523beace915526122 /synapse/handlers/e2e_keys.py | |
parent | Move Spam Checker callbacks to a dedicated file (#15453) (diff) | |
download | synapse-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 'synapse/handlers/e2e_keys.py')
0 files changed, 0 insertions, 0 deletions