From c78b36d3a377c4be6967deb656b9c7cfe859340d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 11 Mar 2019 21:38:21 +0800 Subject: [PATCH] crimson/os: use transparent comparator in xattr so we don't need to allocate a temporary string for looking up OI or SS attribute Signed-off-by: Kefu Chai --- src/crimson/os/cyan_object.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crimson/os/cyan_object.h b/src/crimson/os/cyan_object.h index 6846b1a4dc5..4806589daa9 100644 --- a/src/crimson/os/cyan_object.h +++ b/src/crimson/os/cyan_object.h @@ -16,7 +16,9 @@ struct Object : public boost::intrusive_ref_counter< using bufferlist = ceph::bufferlist; bufferlist data; - std::map xattr; + // use transparent comparator for better performance, see + // https://en.cppreference.com/w/cpp/utility/functional/less_void + std::map> xattr; bufferlist omap_header; std::map omap; -- 2.39.5