Skip to content
Snippets Groups Projects
  1. Apr 18, 2023
    • Val Lorentz's avatar
      Speedup tests by caching HomeServerConfig instances (#15284) · cb8e274c
      Val Lorentz authored
      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.
      Unverified
      cb8e274c
Loading