Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid writing to the config file if not necessary
Writing to the config file to update the server list has a cost of about 0.65 seconds on my M1 Mac, making the startup jump from around 0.35 seconds to 1 second. This may be due to writing to a file but also could be a delay in obtaining the config lock. Updating the server list does not actually need to be done all the time. Instead, this commit checks if there is actually any missing servers by comparing the list of contexts with the list of servers, and only if there are missing servers will it trigger the update. This reduces by 65% the execution time for commands that don't access the backend; this means that shell completion for commands and flags becomes noticeably more responsive. Signed-off-by: Marc Khouzam <[email protected]>
- Loading branch information