mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
983f454135
Summary: Add a config option to restrict the number of tree prefetches that can run in parallel. Without this applications that recursively walk a checkout tree can end up spawning a huge number of asynchronous prefetch operations. These prefetch operations are quite expensive today, as we currently have to fetch the full file contents in order to retrieve the file sizes. A recursive directory walk can end up building up a huge backlog of in-progress tree prefetches. This will slow down the directory walk, and it can take tens of minutes to finish processing the prefetch backlog even after the directory walk is aborted. Reviewed By: chadaustin Differential Revision: D19136685 fbshipit-source-id: cdc7a570d016fd7ca81a639cef83380b197acdfc
23 lines
464 B
C++
23 lines
464 B
C++
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#include "eden/fs/inodes/TreePrefetchLease.h"
|
|
|
|
#include "eden/fs/inodes/EdenMount.h"
|
|
|
|
namespace facebook {
|
|
namespace eden {
|
|
|
|
void TreePrefetchLease::release() noexcept {
|
|
if (inode_) {
|
|
inode_->getMount()->treePrefetchFinished();
|
|
}
|
|
}
|
|
|
|
} // namespace eden
|
|
} // namespace facebook
|