You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2020/11/19 00:05:53 UTC

[incubator-datasketches-cpp] 01/02: slight performance improvement

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch req_sketch
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git

commit da61cccbfbc72f0ac4eba0d18475a023f3a9c340
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Wed Nov 18 16:03:53 2020 -0800

    slight performance improvement
---
 req/include/req_compactor_impl.hpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/req/include/req_compactor_impl.hpp b/req/include/req_compactor_impl.hpp
index cc44ea6..316378a 100755
--- a/req/include/req_compactor_impl.hpp
+++ b/req/include/req_compactor_impl.hpp
@@ -324,6 +324,7 @@ std::pair<std::vector<T, A>, size_t> req_compactor<T, H, C, A>::deserialize_item
   const char* ptr = static_cast<const char*>(bytes);
   const char* end_ptr = static_cast<const char*>(bytes) + size;
   std::vector<T, A> items(allocator);
+  items.reserve(num);
   A alloc(allocator);
   auto item_buffer_deleter = [&alloc](T* ptr) { alloc.deallocate(ptr, 1); };
   std::unique_ptr<T, decltype(item_buffer_deleter)> item_buffer(alloc.allocate(1), item_buffer_deleter);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org