Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid blocking on CloseHandle #1850

Merged
merged 2 commits into from
May 18, 2019
Merged

Commits on May 18, 2019

  1. Customisable tracker units

    Files are in bytes, but other things we may track are not.
    rbtcollins committed May 18, 2019
    Configuration menu
    Copy the full SHA
    fd6c31f View commit details
    Browse the repository at this point in the history
  2. Avoid blocking on CloseHandle

    On Windows closing a file involves CloseHandle, which can be quite
    slow (6+ms) for various reasons, including circumstances outside our
    control such as virus scanners, content indexing, device driver cache
    write-back synchronisation and so forth. Rather than having a super
    long list of all the things users need to do to optimise the performance
    of CloseHandle, use a small threadpool to avoid blocking package
    extraction when closing file handles.
    
    This does run a risk of resource exhaustion, but as we only have 20k
    files in the largest package today that should not be a problem in
    practice.
    
    https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-January/078404.html
    provided inspiration for this.
    
    My benchmark system went from 21/22s to 11s with this change with both
    4 or 8 threads.
    rbtcollins committed May 18, 2019
    Configuration menu
    Copy the full SHA
    ff0dc0d View commit details
    Browse the repository at this point in the history