Improve FanoutConfigurationResource loading performance
When using replication remotes as individual files under
$GERRIT_SITE/etc/replication the time requested to load the remotes,
parsing them and merging them together can be very significant,
especially when having a lot of remote configurations.
On GerritHub.io with 12k remotes configured, the time to load,
parse and merge them in a unique FileBasedConfig object reaches
several minutes.
The main issue found during profiling is the manual merging of
Config through one call per setting using Config.setStringList()
rather than merging them first and then parsing them as a whole.
Refactor the overall parsing logic by splitting the process in
three parts:
- load of all replication remotes a list of String
- expanding them as individual strings and adding the remote names
- merging them together with the base config using the JGit's
default mechanism
From an external perspective, the API work exactly as before, including
the config validation process; from a performance perspective, the
loading of 12k remotes is reduced by 20x times, taking under 1 minute.
Change-Id: I2880428b881034e6253d07ab0ba368c0a97eecc0
1 file changed