Hg state slow for the first time

Does anyone know why it hg statusis slow (3-10 seconds) on the first call from the command line on the Windows client (I assume that it is cached after that).

hg status - This is a local operation, and it should not take much time, especially with empty repositories.

This applies to both the active repository with a few changes and the new repo without files. Therefore, repo size is not a performance factor. Thank!

+3
source share
1 answer

When you run the command hg status, Mercurial should scan almost every directory and file in your repository so that it can display the status of the file. Hg must make at least one expensive system call for each managed file to determine if it has changed since the last Mercurial check, without avoiding it.

I believe that the reason why subsequent calls are hg stfaster is due to the cached information that the OS stores in all recently received files - eliminating disk access if the file has not been modified. Sometimes the files themselves may even remain in memory mapped by the OS or fully cached in the hard disk buffer.

Edit: , hg , hg , RAM .

+7

Source: https://habr.com/ru/post/1761345/


All Articles