mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-23 01:55:53 +03:00
cb8e274c07
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.
1 line
53 B
Text
1 line
53 B
Text
Speedup tests by caching HomeServerConfig instances.
|