mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
1a1da38248
Summary: # Intercept manifest.revision(..). The cache is checked, and if it's not there, resume the normal path. Once the normal path is complete, write to the cache. # Intercept manifest._addrevision(..). This may be used in bulk operations, such as pull. Since we don't want to flood the cache with a lot of entries we may not care about, we record all the nodes that are added. We add an atexit hook to then record the last N nodes to the cache. # Writes to the cache are done to a temp file, then atomically renamed into place. # On reads, we run the checkhash function. This costs us ~100ms per manifest in fbsource, but ensures a corrupt cache doesn't break us. Love to debate this matter. # On each batch of writes, we spawn a background copy of ourselves to prune the cache. We use the mtime of a marker file to determine the last time the prune happened. We calculate the odds that we should be doing the prune using a couple constants and the time since the last prune. If another prune happened recently, the dominant factor is a small probability that we run the prune, regardless of the interval. If no prune has happened recently, the dominant factor is the seconds-since-prune configuration variable. Some performance numbers (all averaged across 10 runs) * diff between two revs: 2.29s without caching; 1.75s with caching * rebasing 4 diffs: 12.1s without caching; 10.7s with caching Test Plan: passed the rudimentary correctness unit tests. with fbsource, ran a small handful of commands without anybody tripping and falling. Reviewers: rmcelroy, ericsumner, mpm, pyd, durham Reviewed By: durham Subscribers: akushner, mitrandir, cdelahousse Differential Revision: https://phabricator.fb.com/D2564490 Signature: t1:2564490:1449075868:70974c62e6bff6521b6f500b5bff3a260ddd6c6d |
||
---|---|---|
.. | ||
conduithttp.py | ||
copytrace.sh | ||
dummyssh | ||
histedit-helpers.sh | ||
killdaemons.py | ||
printenv.py | ||
run-tests.py | ||
test-automv.t | ||
test-bundle2.t | ||
test-catnotate.t | ||
test-commitextras.t | ||
test-copytrace.t | ||
test-dirsync.t | ||
test-fbamend.t | ||
test-fbconduit.t | ||
test-fbhistedit-exec-obsolete.t | ||
test-fbhistedit-exec.t | ||
test-fbhistedit-stop-obsolete.t | ||
test-fbhistedit-stop.t | ||
test-filldb.t | ||
test-git-getmeta.t | ||
test-githelp.t | ||
test-gitlikebookmarks.t | ||
test-inhibitwarn.t | ||
test-manifestdiskcache.t | ||
test-mergedriver.t | ||
test-morestatus.t | ||
test-perftweaks.t | ||
test-phabdiff.t | ||
test-pushrebase-protection.t | ||
test-pushrebase-remotenames.t | ||
test-pushrebase.t | ||
test-pushvars-remotenames.t | ||
test-pushvars.t | ||
test-reflog-remotenames.t | ||
test-reflog.t | ||
test-reset-remotenames.t | ||
test-reset.t | ||
test-simplecache.t | ||
test-smartlog-remotenames.t | ||
test-smartlog.t | ||
test-sparse-extensions.t | ||
test-sparse-merges.t | ||
test-sparse-profiles.t | ||
test-sparse.t | ||
test-tweakdefaults-ordering.t | ||
test-tweakdefaults-remotenames.t | ||
test-tweakdefaults.t | ||
test-writecg2.t |