From 70da01aed31e288fa2dd772907a2c043dcf51174 Mon Sep 17 00:00:00 2001 From: Alex Hornby Date: Fri, 24 Sep 2021 09:38:51 -0700 Subject: [PATCH] mononoke: skiplist deserialization can move the Bytes Summary: No need to keep the Bytes live after compact_protocol::deserialize, can move them into it instead. Makes it clearer bytes aren't reused, and should have some small effect on peak memory usage during deserialization by freeing the Bytes buffer earlier Reviewed By: StanislavGlebik Differential Revision: D31149815 fbshipit-source-id: 858914d2d8e3d91b5e863053dfeeb5d5ec37b9eb --- eden/mononoke/reachabilityindex/skiplist/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eden/mononoke/reachabilityindex/skiplist/src/lib.rs b/eden/mononoke/reachabilityindex/skiplist/src/lib.rs index 8c470b1e1f..d6500425e3 100644 --- a/eden/mononoke/reachabilityindex/skiplist/src/lib.rs +++ b/eden/mononoke/reachabilityindex/skiplist/src/lib.rs @@ -137,7 +137,7 @@ pub fn deserialize_skiplist_index(logger: Logger, bytes: Bytes) -> Result Result { - let map: HashMap<_, skiplist_thrift::SkiplistNodeType> = compact_protocol::deserialize(&bytes)?; + let map: HashMap<_, skiplist_thrift::SkiplistNodeType> = compact_protocol::deserialize(bytes)?; let cmap: DashMap = DashMap::with_capacity(map.len()); let mut pnodecount = 0; let mut snodecount = 0;