sapling/eden/fs/config/ReaddirPrefetch.h
Chad Austin 5da3dec645 rewrite readdir prefetching logic
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
2023-01-04 19:17:36 -08:00

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