mirror of
https://github.com/facebook/sapling.git
synced 2024-10-05 06:18:07 +03:00
bring back fbstring for PathComponent - reduces PathMap memory usage
Summary: In my benchmarks, using fbstring over std::string for PathMap is worthwhile. There are a lot of entries stored in PathMap and the fact that fbstring is a word smaller than std::string adds up. Differential Revision: D6820204 fbshipit-source-id: 1ac34a81828891eb8125b13a074de6ed9715edad
This commit is contained in:
parent
ec9ff7e3ef
commit
13176097df
@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
#include <boost/operators.hpp>
|
||||
#include <folly/Expected.h>
|
||||
#include <folly/FBString.h>
|
||||
#include <folly/Format.h>
|
||||
#include <folly/String.h>
|
||||
#include <folly/hash/Hash.h>
|
||||
@ -87,7 +88,10 @@ template <typename STR>
|
||||
class AbsolutePathBase;
|
||||
} // namespace detail
|
||||
|
||||
using PathComponent = detail::PathComponentBase<std::string>;
|
||||
// Intentionally use folly::fbstring because Dir entries are keyed on
|
||||
// PathComponent and the fact that folly::fbstring is 24 bytes and std::string
|
||||
// is 32 bytes adds up.
|
||||
using PathComponent = detail::PathComponentBase<folly::fbstring>;
|
||||
using PathComponentPiece = detail::PathComponentBase<folly::StringPiece>;
|
||||
|
||||
using RelativePath = detail::RelativePathBase<std::string>;
|
||||
|
@ -60,6 +60,7 @@ cpp_library(
|
||||
deps = [
|
||||
"//folly:exception",
|
||||
"//folly:expected",
|
||||
"//folly:fbstring",
|
||||
"//folly:format",
|
||||
"//folly:optional",
|
||||
"//folly:string",
|
||||
|
Loading…
Reference in New Issue
Block a user