This is an archive of the discontinued Mercurial Phabricator instance.

dirstate-tree: Skip readdir() in `hg status -mard`
ClosedPublic

Authored by SimonSapin on May 19 2021, 12:37 PM.

Details

Summary

When running the status algorithm in a mode where we don’t list unknown
or ignored files, all we care about are files that are listed in the dirstate.
We can there for skip making expensive calls to readdir() to list the contents
of filesystem directories, and instead only run stat() to get the filesystem
state of files listed in the dirstate. (This state may be an error for files
that don’t exist anymore on the filesystem.)

On 16 CPU threads, this reduces the time spent in the status() function for
hg status -mard on an old snapshot of mozilla-central from ~70ms to ~50ms.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

SimonSapin created this revision.May 19 2021, 12:37 PM
baymax updated this revision to Diff 28176.May 21 2021, 4:37 AM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare accepted this revision.May 21 2021, 5:54 AM
This revision is now accepted and ready to land.May 21 2021, 5:54 AM
baymax updated this revision to Diff 28275.May 30 2021, 3:27 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

This revision was automatically updated to reflect the committed changes.
alomax added a subscriber: alomax.Oct 29 2021, 10:28 PM

The motive of providing accounts of all ranges on our platform is to give customers what they demand and what they deserve.<br>
cheap csgo accounts
buy csgo prime accounts
buy high tier csgo accounts
cheap valorant accounts
buy gta 5 accounts