From 9e38c8905d4ef0bf71ac05f05cd9289abbe9b450 Mon Sep 17 00:00:00 2001
From: Danilo Piparo <danilo.piparo@cern.ch>
Date: Thu, 28 Mar 2019 15:06:24 +0100
Subject: [PATCH] [RVec] Further refine SBO code to improve performance

---
 math/vecops/inc/ROOT/RVec.hxx | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/math/vecops/inc/ROOT/RVec.hxx b/math/vecops/inc/ROOT/RVec.hxx
index c2dd4abcbea..e558a65e363 100644
--- a/math/vecops/inc/ROOT/RVec.hxx
+++ b/math/vecops/inc/ROOT/RVec.hxx
@@ -261,7 +261,7 @@ public:
    using const_iterator = typename Impl_t::const_iterator;
    using reverse_iterator = typename Impl_t::reverse_iterator;
    using const_reverse_iterator = typename Impl_t::const_reverse_iterator;
-   static constexpr std::size_t fgBufferSize = std::is_arithmetic<T>::value && !fgIsVecBool ? 32 : 0;
+   static constexpr std::size_t fgBufferSize = std::is_arithmetic<T>::value && !fgIsVecBool ? 16 : 0;
 
 private:
    // We need this class for the case where fgBufferSize is 0, otherwise array<NonCopiable, 0>
@@ -289,17 +289,9 @@ private:
    /// The default storage std::vector, initialised with the allocator
    Impl_t fData{fAlloc};
 
-   bool CanUseBuffer(std::size_t s)
-   {
-      const auto thisBufSize = ::ROOT::Detail::VecOps::GetBufferSize(fAlloc);
-      return thisBufSize && s <= thisBufSize;
-   }
    bool CanUseBuffer(const RVec &v)
    {
       const auto thisBufSize = ::ROOT::Detail::VecOps::GetBufferSize(fAlloc);
-      const auto otherBufSize = ::ROOT::Detail::VecOps::GetBufferSize(v.fAlloc);
-      if (thisBufSize == 0 && otherBufSize == 0)
-         return false;
       return thisBufSize && v.size() <= thisBufSize;
    }
 
-- 
GitLab