mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 14:28:17 +03:00
5da3dec645
Summary: Bring back readdir prefetching, which was disabled as part of the edenapi aux metadata rollout, and tighten up its logic to accelerate specific use cases. To optimize `find .`, prefetch subtrees when a subtree is stat(). To optimize `find . -empty`, prefetch blob metadata when a file is stat(). Add a config knob to opt out of blob prefetching, tree prefetching, or both. Reviewed By: xavierd Differential Revision: D41701675 fbshipit-source-id: 29b9c28f0f09cf686e3f256bd8c993e9b466e012
32 lines
645 B
C++
32 lines
645 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This software may be used and distributed according to the terms of the
|
|
* GNU General Public License version 2.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "eden/fs/config/FieldConverter.h"
|
|
|
|
namespace facebook::eden {
|
|
|
|
enum class ReaddirPrefetch {
|
|
None,
|
|
Files,
|
|
Trees,
|
|
Both,
|
|
};
|
|
|
|
template <>
|
|
class FieldConverter<ReaddirPrefetch> {
|
|
public:
|
|
folly::Expected<ReaddirPrefetch, std::string> fromString(
|
|
folly::StringPiece value,
|
|
const std::map<std::string, std::string>& convData) const;
|
|
|
|
std::string toDebugString(ReaddirPrefetch value) const;
|
|
};
|
|
|
|
} // namespace facebook::eden
|