diff --git a/Control/StoreGate/CMakeLists.txt b/Control/StoreGate/CMakeLists.txt
index a7462e368bac7205311ed94e9db1026e702dac62..76ba35f805919fd8542affd0687f8a18833cf100 100644
--- a/Control/StoreGate/CMakeLists.txt
+++ b/Control/StoreGate/CMakeLists.txt
@@ -1,4 +1,4 @@
-# $Id: CMakeLists.txt 743842 2016-04-29 08:16:42Z ssnyder $
+# $Id: CMakeLists.txt 794854 2017-01-31 23:34:36Z leggett $
 ################################################################################
 # Package: StoreGate
 ################################################################################
@@ -45,11 +45,13 @@ atlas_add_test( ActiveStore_test
    EXTRA_PATTERNS "JobOptionsSvc +INFO"
    ENVIRONMENT "JOBOPTSEARCHPATH=${CMAKE_CURRENT_SOURCE_DIR}/share" )
 
-if( ATHENAHIVE )
    set( _hivePatterns "JobOptionsSvc +INFO|StoreGateSvc.*DEBUG|HiveMgrSvc +DEBUG" )
-else()
-   set( _hivePatterns ".*" )
-endif()
+
+atlas_add_test( SGTiming_test
+   SOURCES test/SGTiming_test.cxx
+   LINK_LIBRARIES SGtests
+   EXTRA_PATTERNS "${_hivePatterns}|rec:|averages" )
+
 atlas_add_test( SGHive_test
    SOURCES test/SGHive_test.cxx
    LINK_LIBRARIES SGtests
@@ -134,5 +136,6 @@ atlas_install_python_modules( python/*.py )
 atlas_install_joboptions( share/StoreGate_jobOptions.txt
    share/StoreGate_jobOptions.py
    share/SGHive_test.txt
+   share/SGTiming_test.txt
    share/ActiveStore_test.txt )
 
diff --git a/Control/StoreGate/StoreGate/SGHiveEventSlot.h b/Control/StoreGate/StoreGate/SGHiveEventSlot.h
index 96cbc96576bd71f71ee3e7ba8ba947b27125d8b8..4af0ae244ba8be85451ac57d939ae273e1123ba2 100644
--- a/Control/StoreGate/StoreGate/SGHiveEventSlot.h
+++ b/Control/StoreGate/StoreGate/SGHiveEventSlot.h
@@ -8,21 +8,22 @@
  *  @brief A structure created by HiveMgrSvc and used by SGHiveStoreSvc
  *  to forward the StoreGateSvc method to a thread-specific SGImplSvc
  *
- *  $Id: SGHiveEventSlot.h 637398 2014-12-23 20:45:22Z calaf $
+ *  $Id: SGHiveEventSlot.h 794854 2017-01-31 23:34:36Z leggett $
  **/
-#include "tbb/recursive_mutex.h"
+#include <mutex>
+#include <memory>
 
 class SGImplSvc;
 
 namespace SG {
   struct HiveEventSlot {
-    typedef tbb::recursive_mutex mutex_t;
+    typedef std::recursive_mutex mutex_t;
     friend class TestSGHiveMgrSvc;
     HiveEventSlot(SGImplSvc* pSG=0, int evt=-1) : 
-      pEvtStore(pSG), eventNumber(evt) {}
+      pEvtStore(pSG), eventNumber(evt), storeMutex(new mutex_t) {}
     SGImplSvc* pEvtStore;
     int eventNumber;
-    mutex_t storeMutex;
+    std::unique_ptr<mutex_t> storeMutex;
   };
 }
 #endif // STOREGATE_SGHIVEEVENTSLOT
diff --git a/Control/StoreGate/StoreGate/StoreGateSvc.h b/Control/StoreGate/StoreGate/StoreGateSvc.h
index f8ae1db12e32a46569157a3625247e8f680cb563..c848e13adbb9c57f6d98c6b6fdf128cbb0d3f49e 100644
--- a/Control/StoreGate/StoreGate/StoreGateSvc.h
+++ b/Control/StoreGate/StoreGate/StoreGateSvc.h
@@ -12,10 +12,6 @@
 //include below in your header file!
 #include "SGTools/CLASS_DEF.h"
 
-#ifndef ATHENAHIVE
-#define SGImplSvc StoreGateSvc
-#include "StoreGate/tools/SGImplSvc.h"
-#else
 //HIVE wrapper implementation
 //base classes
 #include "GaudiKernel/Service.h"
@@ -1085,5 +1081,4 @@ struct PyGate {
   }
 };
 
-#endif //ATHENAHIVE
 #endif // STOREGATE_STOREGATESVC_H
diff --git a/Control/StoreGate/StoreGate/StoreGateSvc.icc b/Control/StoreGate/StoreGate/StoreGateSvc.icc
index f58f6ab3df7cc7cc99131b353f3c666ca42fb06f..a7cc505aec901707a0dbe3b1aaa28dbe66375cfc 100644
--- a/Control/StoreGate/StoreGate/StoreGateSvc.icc
+++ b/Control/StoreGate/StoreGate/StoreGateSvc.icc
@@ -17,7 +17,7 @@
 #define _SGXCALL(FUN,ARGS,ONERR)                                        \
   if (isHiveStore()) {                                                  \
     SG::HiveEventSlot* pSlot(StoreGateSvc::currentSlot());              \
-    SG::HiveEventSlot::mutex_t::scoped_lock lock; lock.acquire(pSlot->storeMutex); \
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock( *(pSlot->storeMutex) ); \
     return (0 != pSlot->pEvtStore) ?                                    \
       pSlot->pEvtStore->FUN ARGS : ONERR;                               \
   } else {                                                              \
@@ -28,7 +28,7 @@
 #define _SGVOIDCALL(FUN,ARGS)                                           \
   if (isHiveStore()) {                                                  \
     SG::HiveEventSlot* pSlot(StoreGateSvc::currentSlot());              \
-    SG::HiveEventSlot::mutex_t::scoped_lock lock; lock.acquire(pSlot->storeMutex); \
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock( *(pSlot->storeMutex) ); \
     if (0 != pSlot->pEvtStore) pSlot->pEvtStore->FUN ARGS;              \
   } else {                                                              \
     std::lock_guard<std::recursive_mutex> lock (m_recMutex);            \
@@ -470,7 +470,7 @@ std::unique_ptr<T>
 StoreGateSvc::readUniquePrivateCopy (const std::string& key) {
   if (isHiveStore()) {                                                  
     SG::HiveEventSlot* pSlot(StoreGateSvc::currentSlot());              
-    SG::HiveEventSlot::mutex_t::scoped_lock lock; lock.acquire(pSlot->storeMutex); 
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock( *(pSlot->storeMutex) );
     return (0 != pSlot->pEvtStore) ?                                    
       pSlot->pEvtStore->readUniquePrivateCopy<T>(key) :
       std::unique_ptr<T>{};                     
@@ -486,7 +486,7 @@ std::unique_ptr<T>
 StoreGateSvc::retrieveUniquePrivateCopy (const std::string& key) {
   if (isHiveStore()) {                                                  
     SG::HiveEventSlot* pSlot(StoreGateSvc::currentSlot());              
-    SG::HiveEventSlot::mutex_t::scoped_lock lock; lock.acquire(pSlot->storeMutex); 
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock( *(pSlot->storeMutex) );
     return (0 != pSlot->pEvtStore) ?                                    
       pSlot->pEvtStore->retrieveUniquePrivateCopy<T>(key) :
       std::unique_ptr<T>{};                     
diff --git a/Control/StoreGate/StoreGate/tools/SGImplSvc.h b/Control/StoreGate/StoreGate/tools/SGImplSvc.h
index f7a7638887f7b8f0dfad96d8667dcc969b2bf87d..a112497a7108049a9c1a0783c244eee0dd43ee24 100644
--- a/Control/StoreGate/StoreGate/tools/SGImplSvc.h
+++ b/Control/StoreGate/StoreGate/tools/SGImplSvc.h
@@ -112,7 +112,7 @@ namespace PerfMon { class StorePayloadMon; }
  * @param "FolderNameList" property (default ""): data folders to be created 
  *                                                in this store
  * @author ATLAS Collaboration
- * $Id: SGImplSvc.h 785927 2016-11-23 03:58:33Z ssnyder $
+ * $Id: SGImplSvc.h 794854 2017-01-31 23:34:36Z leggett $
  **/
 class SGImplSvc :
   public Service, 
@@ -982,9 +982,7 @@ private:
   friend class EventDumperSvc;
   friend class MemoryMonitorSvc;
   friend void testHLTAutoKeyReset(SGImplSvc&, IProxyProviderSvc&);
-#ifdef ATHENAHIVE
   friend class StoreGateSvc;
-#endif
   ///access typeless_record
   friend class ThinningSvc;
   friend class SG::VarHandleBase;                                                      
@@ -1167,6 +1165,7 @@ public:
 private:
   SGImplSvc (const SGImplSvc&);
   SGImplSvc& operator= (const SGImplSvc&);
+
 };
 
 
@@ -1176,27 +1175,28 @@ void SG_dump (SGImplSvc* sg);
 
 #include "StoreGate/tools/SGImplSvc.icc"
 
-#ifndef ATHENAHIVE
-//- PyGate: StoreGate access from python -------------------------------------
-template< class T >
-struct PyGate {
-  // default object retrieval
-  static const T* retrieve( SGImplSvc* psg ) {
-    const T* obj = 0;
-    if ( StatusCode::SUCCESS == psg->retrieve( obj ) )
-      return obj;
-    return 0;
-  }
-
-  // object retrieval with string key
-  static const T* retrieve( SGImplSvc* psg, const std::string& key ) {
-    const T* obj = 0;
-    if ( StatusCode::SUCCESS == psg->retrieve( obj, key ) )
-      return obj;
-    return 0;
-  }
-};
-#endif
+// FIXME!!!
+// #ifndef ATHENAHIVE
+// //- PyGate: StoreGate access from python -------------------------------------
+// template< class T >
+// struct PyGate {
+//   // default object retrieval
+//   static const T* retrieve( SGImplSvc* psg ) {
+//     const T* obj = 0;
+//     if ( StatusCode::SUCCESS == psg->retrieve( obj ) )
+//       return obj;
+//     return 0;
+//   }
+
+//   // object retrieval with string key
+//   static const T* retrieve( SGImplSvc* psg, const std::string& key ) {
+//     const T* obj = 0;
+//     if ( StatusCode::SUCCESS == psg->retrieve( obj, key ) )
+//       return obj;
+//     return 0;
+//   }
+// };
+// #endif
 
 // inline methods
 inline
diff --git a/Control/StoreGate/share/SGTiming_test.ref b/Control/StoreGate/share/SGTiming_test.ref
new file mode 100644
index 0000000000000000000000000000000000000000..7034fd7715cd6e1812b7c0b2f555757e08e077df
--- /dev/null
+++ b/Control/StoreGate/share/SGTiming_test.ref
@@ -0,0 +1,123 @@
+**** SGTimingTest BEGINS ****
+
+
+Initializing Gaudi ApplicationMgr using job opts ../share/SGTiming_test.txt
+JobOptionsSvc        INFO # =======> /build1/leggett/work/sgtest/dv3/bld/../share/SGTiming_test.txt
+JobOptionsSvc        INFO # (1,1): StoreGateSvc.OutputLevel = 4
+JobOptionsSvc        INFO Job options successfully read in from ../share/SGTiming_test.txt
+ApplicationMgr    SUCCESS 
+====================================================================================================================================
+                                                   Welcome to ApplicationMgr (GaudiCoreSvc v28r0)
+                                          running on p05614910w96644.cern.ch on Tue Jan 31 23:20:06 2017
+====================================================================================================================================
+ApplicationMgr       INFO Application Manager Configured successfully
+EventLoopMgr      WARNING Unable to locate service "EventSelector" 
+EventLoopMgr      WARNING No events will be processed from external input.
+HistogramPersis...WARNING Histograms saving not required.
+ApplicationMgr       INFO Application Manager Initialized successfully
+ApplicationMgr Ready
+ClassIDSvc           INFO  getRegistryEntries: read 188 CLIDRegistry entries for module ALL
+ClassIDSvc           INFO  getRegistryEntries: read 867 CLIDRegistry entries for module ALL
+rec:     1772  ret:       83  clr:      112
+rec:      147  ret:       36  clr:       19
+rec:      141  ret:       35  clr:       17
+rec:      146  ret:       35  clr:       17
+rec:      139  ret:       35  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      146  ret:       35  clr:       17
+rec:      140  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       35  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       16
+rec:      138  ret:       34  clr:       17
+rec:      154  ret:       35  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      171  ret:       36  clr:       18
+rec:      139  ret:       34  clr:       17
+rec:      144  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       39  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      135  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      146  ret:       34  clr:       17
+rec:      136  ret:       35  clr:       17
+rec:      137  ret:       34  clr:       17
+rec:      136  ret:       33  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      142  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      137  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      136  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       39  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       33  clr:       17
+rec:      147  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       33  clr:       17
+rec:      144  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       38  clr:       17
+rec:      139  ret:       33  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      152  ret:       35  clr:       17
+rec:      146  ret:       34  clr:       17
+rec:      146  ret:       34  clr:       17
+rec:      169  ret:       35  clr:       18
+rec:      138  ret:       39  clr:       18
+rec:      139  ret:       35  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      144  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       16
+rec:      144  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       35  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      140  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      143  ret:       34  clr:       17
+rec:      140  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      145  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      137  ret:       34  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      138  ret:       34  clr:       17
+rec:      139  ret:       35  clr:       17
+rec:      139  ret:       34  clr:       17
+rec:      137  ret:       34  clr:       17
+===== averages  TYPES: 20  KEYS: 5  iter: 100 ===============
+20/5 rec:   1.40  ret:   0.34  clr:   0.17
+**** SGTimingTest ENDS ****
diff --git a/Control/StoreGate/share/SGTiming_test.txt b/Control/StoreGate/share/SGTiming_test.txt
new file mode 100644
index 0000000000000000000000000000000000000000..5e7b12502e1545775ba4215b35260b8a274961cc
--- /dev/null
+++ b/Control/StoreGate/share/SGTiming_test.txt
@@ -0,0 +1 @@
+StoreGateSvc.OutputLevel=4;
diff --git a/Control/StoreGate/src/SGHiveMgrSvc.cxx b/Control/StoreGate/src/SGHiveMgrSvc.cxx
index 2a0079e6775effb36e684569c70d14a2045b8c7e..15818599011324b7b015cfb32e10b305bd387892 100644
--- a/Control/StoreGate/src/SGHiveMgrSvc.cxx
+++ b/Control/StoreGate/src/SGHiveMgrSvc.cxx
@@ -28,17 +28,11 @@ HiveMgrSvc::HiveMgrSvc(const std::string& name,
  * @param  slot     [IN]     Slot number (event slot)   *
  * @return Status code indicating failure or success.
  */
-#ifdef ATHENAHIVE
 StatusCode HiveMgrSvc::selectStore(size_t slotIndex) {
   s_current = &m_slots[slotIndex];
   StoreGateSvc::setSlot(s_current);
   return StatusCode::SUCCESS;
 }
-#else
-StatusCode HiveMgrSvc::selectStore(size_t /*slotIndex*/) {
-  return StatusCode::SUCCESS;
-}
-#endif
 
 /** Clear a given 'slot'.
  *
@@ -48,11 +42,7 @@ StatusCode HiveMgrSvc::selectStore(size_t /*slotIndex*/) {
 StatusCode HiveMgrSvc::clearStore(size_t slotIndex) {
   StatusCode rc(StatusCode::FAILURE);
   if (slotIndex < m_nSlots) {
-#ifdef ATHENAHIVE
     rc=m_slots[slotIndex].pEvtStore->clearStore();
-#else
-    rc = m_hiveStore->clearStore();
-#endif
     if (rc.isSuccess()) debug() << "cleared store " << slotIndex << endmsg;
   }    
   if (!rc.isSuccess()) error() << "could not clear store " << slotIndex << endmsg;
@@ -70,12 +60,8 @@ StatusCode HiveMgrSvc::setNumberOfStores(size_t slots) {
     fatal() << "Too late to change the number of slots!" << endmsg;
     return StatusCode::FAILURE;
   } else {
-#ifdef ATHENAHIVE
     m_slots.resize(slots);
     m_nSlots = slots;
-#else
-    if (slots != 1) return StatusCode::FAILURE;
-#endif
     return StatusCode::SUCCESS;
   }
 }
@@ -92,7 +78,6 @@ size_t HiveMgrSvc::getNumberOfStores() const {
  * @param     slot     [OUT]    Returned slot or slot number
  * @return Slot number (npos to indicate an error).
  */
-#ifdef ATHENAHIVE
 size_t HiveMgrSvc::allocateStore( int evtNumber ) {
   for (size_t index=0; index<m_nSlots; ++index) {
     if( m_slots[index].eventNumber == evtNumber) {
@@ -108,12 +93,6 @@ size_t HiveMgrSvc::allocateStore( int evtNumber ) {
   error() << "No slots available for event number " << evtNumber << endmsg;
   return std::string::npos;
 }
-#else
-size_t HiveMgrSvc::allocateStore( int /*evtNumber*/ )
-{
-  return 0;
-}
-#endif
   
 /** Free a store slot
  *
@@ -122,9 +101,7 @@ size_t HiveMgrSvc::allocateStore( int /*evtNumber*/ )
  */
 StatusCode HiveMgrSvc::freeStore( size_t slotIndex ) {
   if (slotIndex < m_nSlots) {
-#ifdef ATHENAHIVE
     m_slots[slotIndex].eventNumber = -1;
-#endif
     debug() << "Freed slot " << slotIndex << endmsg;
     return StatusCode::SUCCESS;
   } else {
@@ -139,18 +116,12 @@ StatusCode HiveMgrSvc::freeStore( size_t slotIndex ) {
  * @param     evtNumber     [IN]     Event number
  * @return    slot number (npos to indicate an error).
  */
-#ifdef ATHENAHIVE
 size_t HiveMgrSvc::getPartitionNumber(int evtNumber) const {
   for (size_t index=0; index<m_nSlots; ++index) {
     if( m_slots[index].eventNumber == evtNumber) return index;
   }
   return std::string::npos;
 }
-#else
-size_t HiveMgrSvc::getPartitionNumber(int /*evtNumber*/) const {
-  return 0;
-}
-#endif
 
 
 StatusCode HiveMgrSvc::getNewDataObjects(DataObjIDColl& products) {
@@ -175,7 +146,6 @@ StatusCode HiveMgrSvc::initialize() {
     return StatusCode::FAILURE;
   }
 
-#ifdef ATHENAHIVE
   //use hiveStore default impl store as prototype
   Service* child(0);
   SGImplSvc* pSG(0);
@@ -194,26 +164,18 @@ StatusCode HiveMgrSvc::initialize() {
       return StatusCode::FAILURE;
     }
   }
-#else
-  if (m_nSlots != 1) {
-    fatal() << "Bad value of NSlots for serial build: " << m_nSlots << endmsg;
-    return StatusCode::FAILURE;
-  }
-#endif
   return selectStore(0);
 }
 StatusCode HiveMgrSvc::finalize() {
   info() <<  "Finalizing " << name() 
          << " - package version " << PACKAGE_VERSION << endmsg ;
 
-#ifdef ATHENAHIVE
   for (SG::HiveEventSlot& s : m_slots) {
     // The impl services are not set to active, so ServiceMananger
     // won't finalize them.
     CHECK( s.pEvtStore->finalize() );
     s.pEvtStore->release();
   }
-#endif
 
   return StatusCode::SUCCESS;
 }
diff --git a/Control/StoreGate/src/SGHiveMgrSvc.h b/Control/StoreGate/src/SGHiveMgrSvc.h
index 108335039e33e139381c75777e5a47adfdf651ee..dbb858d0fcb898a87eacef70faa8359c18ad5012 100644
--- a/Control/StoreGate/src/SGHiveMgrSvc.h
+++ b/Control/StoreGate/src/SGHiveMgrSvc.h
@@ -26,7 +26,7 @@ template <class TYPE> class SvcFactory;
  *  @brief A service that manages a multi-event collection of StoreGateSvc
  *  It implements the IHiveWhiteBoard interface
  *
- *  $Id: SGHiveMgrSvc.h 783783 2016-11-11 18:25:23Z leggett $
+ *  $Id: SGHiveMgrSvc.h 794854 2017-01-31 23:34:36Z leggett $
  **/
 namespace SG {
 class HiveMgrSvc : virtual public IHiveWhiteBoard, public Service {
@@ -108,9 +108,7 @@ public:
 private:
   ServiceHandle<StoreGateSvc> m_hiveStore;
   size_t m_nSlots; //property settable also by setNumberOfStores
-#ifdef ATHENAHIVE
   std::vector<SG::HiveEventSlot> m_slots;
-#endif
   //maybe  ServiceHandle<ActiveStoreSvc> m_active;
 
 protected:
diff --git a/Control/StoreGate/src/SGImplSvc.cxx b/Control/StoreGate/src/SGImplSvc.cxx
index d700d216fd9d3a72089bd87a80a4cedbe20a05d6..13f49959c0a6bc5e1469b7bbfc6f3c2de94cd300 100644
--- a/Control/StoreGate/src/SGImplSvc.cxx
+++ b/Control/StoreGate/src/SGImplSvc.cxx
@@ -2,9 +2,7 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifdef ATHENAHIVE 
 #define SLOW_NEWDATAOBJECTS 1
-#endif
 #include <algorithm>
 #include <cassert>
 #include <iostream>
@@ -316,13 +314,6 @@ StatusCode SGImplSvc::loadEventProxies() {
   //FIXME this should probably be dealt with by the providers
   if (0 != m_pPPS && !m_storeLoaded) {
     m_storeLoaded = true;
-#ifndef ATHENAHIVE
-    //this (probably) can't be done in initialize (circular init!)
-    ActiveStoreSvc* pActive(0);
-    const bool CREATEIF(true);
-    if (!(serviceLocator()->service("ActiveStoreSvc", pActive, CREATEIF)).isSuccess()) return StatusCode::FAILURE;
-    pActive->setStore(this);
-#endif
     sc=m_pPPS->loadProxies(*m_pStore);
   } 
   return sc;
@@ -354,13 +345,6 @@ StatusCode SGImplSvc::clearStore(bool forceRemove)
   m_remap_impl->m_remaps.clear();
   m_arena.reset();
 
-#ifndef ATHENAHIVE
-  // Send a notification that the store was cleared.
-  // FIXME test forceRemove to avoid calling during finalize. A better solution would be to test m_pIncSvc.m_pObject
-  if (!forceRemove && m_pIncSvc)
-    m_pIncSvc->fireIncident (StoreClearedIncident (this, name()));
-#endif
-
   return StatusCode::SUCCESS;
 }
 //////////////////////////////////////////////////////////////
diff --git a/Control/StoreGate/src/StoreGateSvc.cxx b/Control/StoreGate/src/StoreGateSvc.cxx
index f48646fcb50ca32b814a1564c7a967a89f9288da..a9b28a1bc19c619f89b73acf632fd702c9c97b02 100644
--- a/Control/StoreGate/src/StoreGateSvc.cxx
+++ b/Control/StoreGate/src/StoreGateSvc.cxx
@@ -2,7 +2,6 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifdef ATHENAHIVE
 #include "GaudiKernel/IIncidentSvc.h"
 #include "AthenaKernel/errorcheck.h"
 #include "StoreGate/StoreClearedIncident.h"
@@ -68,8 +67,7 @@ StoreGateSvc::setSlot(SG::HiveEventSlot* pSlot) {
   s_pSlot=pSlot;
   if ( 0 != s_pSlot) {
     //probably overkill since Hive should not call setSlot concurrently     
-    SG::HiveEventSlot::mutex_t::scoped_lock lock;
-    lock.acquire(s_pSlot->storeMutex);
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock(*(s_pSlot->storeMutex));
     s_pSlot->pEvtStore->makeCurrent();
   }
 }
@@ -485,7 +483,7 @@ StoreGateSvc::clearStore(bool forceRemove)
 {
   StatusCode sc;
   if (isHiveStore()) { 
-    SG::HiveEventSlot::mutex_t::scoped_lock lock; lock.acquire(s_pSlot->storeMutex); 
+    std::lock_guard<SG::HiveEventSlot::mutex_t> lock( *(s_pSlot->storeMutex) );
     if (0 != s_pSlot->pEvtStore) {
       sc = s_pSlot->pEvtStore->clearStore(forceRemove);
     }
@@ -543,6 +541,3 @@ StatusCode StoreGateSvc::removeProxy(SG::DataProxy* proxy, const void* pTrans,
                                      bool forceRemove) {
   _SGXCALL(removeProxy, (proxy, pTrans, forceRemove), StatusCode::FAILURE);
 }
-
-
-#endif //ATLASHIVE
diff --git a/Control/StoreGate/test/SGHive_test.cxx b/Control/StoreGate/test/SGHive_test.cxx
index 066903f646bbeae6480f57626ad69714a847321d..3c0070ce22d0269aac63fe2cda364d9560fc88b0 100644
--- a/Control/StoreGate/test/SGHive_test.cxx
+++ b/Control/StoreGate/test/SGHive_test.cxx
@@ -2,14 +2,13 @@
   Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
 */
 
-#ifdef ATHENAHIVE
 /***************************************************************************
   test SGHiveMgrSvc functionality
  ------------------------------
  ATLAS Collaboration
  ***************************************************************************/
 
-// $Id: SGHive_test.cxx 704712 2015-10-29 21:48:11Z leggett $
+// $Id: SGHive_test.cxx 794854 2017-01-31 23:34:36Z leggett $
 
 
 #include <string>
@@ -175,6 +174,3 @@ int main() {
 
   return 0;
 }
-#else
-int main() { return 0; }
-#endif //ATHENAHIVE
diff --git a/Control/StoreGate/test/SGTiming_test.cxx b/Control/StoreGate/test/SGTiming_test.cxx
new file mode 100644
index 0000000000000000000000000000000000000000..b36db4faec438fad65ce8b8e675ac1c6ea7298bb
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test.cxx
@@ -0,0 +1,92 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#undef NDEBUG
+
+#include <string>
+#include <vector>
+#include <chrono>
+#include "TestTools/initGaudi.h"
+using namespace Athena_test;
+#include "TestTools/SGassert.h"
+#include "GaudiKernel/IHiveWhiteBoard.h"
+#include "../src/SGHiveMgrSvc.h"
+#include "StoreGate/StoreGateSvc.h"
+#include "StoreGate/SGtests.h"
+
+#include "SGTiming_test_objs.h"
+#include "SGTiming_test_def.inc"
+
+using namespace std;
+
+int main() {
+
+  cout << "**** SGTimingTest BEGINS ****" << endl;
+
+  ISvcLocator* pSvcLoc;
+  initGaudi("SGTiming_test.txt", pSvcLoc);
+
+  StoreGateSvc* pSG(0);
+  assert( pSvcLoc->service("StoreGateSvc", pSG, true).isSuccess() );
+
+  std::chrono::time_point<std::chrono::high_resolution_clock> start, end;
+
+  std::vector<std::chrono::duration<double>> vd_rec, vd_ret, vd_clr;
+  
+  for (size_t i=0; i<NITER; ++i) {
+    
+#   include "SGTiming_test_ptr.inc"
+    
+    start = std::chrono::high_resolution_clock::now();
+#   include "SGTiming_test_rec.inc"
+    end = std::chrono::high_resolution_clock::now();
+    vd_rec.push_back(end-start);
+
+    start = std::chrono::high_resolution_clock::now();
+#   include "SGTiming_test_ret.inc"
+    end = std::chrono::high_resolution_clock::now();
+    vd_ret.push_back(end-start);
+        
+#   include "SGTiming_test_chk.inc"
+
+    start = std::chrono::high_resolution_clock::now();
+    pSG->clearStore();
+    end = std::chrono::high_resolution_clock::now();
+    vd_clr.push_back(end-start);
+
+    cout << "rec: " << setw(8) 
+         << chrono::duration_cast<chrono::microseconds>(vd_rec[i]).count() 
+         << "  ret: " << setw(8) 
+         << chrono::duration_cast<chrono::microseconds>(vd_ret[i]).count() 
+         << "  clr: " << setw(8)
+         << chrono::duration_cast<chrono::microseconds>(vd_clr[i]).count() 
+         << endl;
+
+    
+  }
+
+  unsigned int a_ret{0}, a_rec{0}, a_clr{0};
+  for (size_t i=1; i<NITER; ++i) {
+    a_rec += chrono::duration_cast<chrono::microseconds>(vd_rec[i]).count();
+    a_ret += chrono::duration_cast<chrono::microseconds>(vd_ret[i]).count();
+    a_clr += chrono::duration_cast<chrono::microseconds>(vd_clr[i]).count();
+  }
+    
+  cout << "===== averages  TYPES: " << NTYPES << "  KEYS: " << NKEYS << "  iter: " 
+       << NITER << " ===============\n";
+
+  cout << NTYPES << "/" << NKEYS << " ";
+  cout << "rec: " << setw(6) << setprecision(2) << fixed
+       << float(a_rec) / ((NITER-1) * NTYPES * NKEYS)
+       << "  ret: " << setw(6)  
+       << float(a_ret) / ((NITER-1) * NTYPES * NKEYS)
+       << "  clr: " << setw(6)  
+       << float(a_clr) / ((NITER-1) * NTYPES * NKEYS)
+       << endl;
+ 
+  cout << "**** SGTimingTest ENDS ****" << endl;
+
+  return 0;
+
+}
diff --git a/Control/StoreGate/test/SGTiming_test_README.txt b/Control/StoreGate/test/SGTiming_test_README.txt
new file mode 100644
index 0000000000000000000000000000000000000000..53b1ba232bc8df45457e3caf9c64fa079200127c
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_README.txt
@@ -0,0 +1,31 @@
+This program will time StoreGate record/retrieve and clearStore
+opeartions.
+
+First you need to run SGTiming_test_gen.pl, which will generate the
+include files and classes. You can adjust the number of types and keys
+(vars NTYPES and NKEYS). The default is 100 classes and 20
+keys. Generating all the CLIDs can be quite slow, so if you are going
+to run many tests, set NTYPES to the larges number you will need,
+generate the files, and then set DO_OBJGEN = 0, which will prevent
+regeneration of the CLIDs, and just read them from the previously
+written file.
+
+It will do the timing test for 100 iterations, clearing the store at
+the end of each iteration. In each iteration of the loop it will
+create all the objects, the do all the records, then do all the
+retrieves, then clear the store. The timing of each section is
+independent. The timing of the record phase does not include the
+creation of the objects.
+
+In DBG builds by default it does an assert on each record/retrieve
+operation, and does not for the OPT builds (by checking value of the
+LCG_PLATFORM env var). This can be overriden if desired.
+
+WARNING: setting NTYPES to a large number makes for a very slow
+compilation, especially in OPT builds.
+
+As it runs, it displays the total time for each set of record /
+retrieve / clearStore operations. At the end of the run, it will
+display the average time per record/retrieve operation in
+microseconds. This average does not include the first iteration of the
+loop, which is usually twice as slow to record.
diff --git a/Control/StoreGate/test/SGTiming_test_chk.inc b/Control/StoreGate/test/SGTiming_test_chk.inc
new file mode 100644
index 0000000000000000000000000000000000000000..77bd78ec5a745431fa1f81aab81c17057dc565f1
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_chk.inc
@@ -0,0 +1,22 @@
+   for (int i=0; i<5; ++i) {
+     if (CVEC_ATNGGE[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_ATNGGE key " << Keys[i] << endl; }
+     if (CVEC_BJBLBR[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_BJBLBR key " << Keys[i] << endl; }
+     if (CVEC_BKTYOQ[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_BKTYOQ key " << Keys[i] << endl; }
+     if (CVEC_DPGYLG[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_DPGYLG key " << Keys[i] << endl; }
+     if (CVEC_EYDAJG[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_EYDAJG key " << Keys[i] << endl; }
+     if (CVEC_EYMPLC[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_EYMPLC key " << Keys[i] << endl; }
+     if (CVEC_FXFSTX[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_FXFSTX key " << Keys[i] << endl; }
+     if (CVEC_HARVAQ[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_HARVAQ key " << Keys[i] << endl; }
+     if (CVEC_HCVLPV[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_HCVLPV key " << Keys[i] << endl; }
+     if (CVEC_JWKFRN[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_JWKFRN key " << Keys[i] << endl; }
+     if (CVEC_NLDRUX[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_NLDRUX key " << Keys[i] << endl; }
+     if (CVEC_OBMCVK[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_OBMCVK key " << Keys[i] << endl; }
+     if (CVEC_PVVIGB[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_PVVIGB key " << Keys[i] << endl; }
+     if (CVEC_QKXILL[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_QKXILL key " << Keys[i] << endl; }
+     if (CVEC_RBLMAX[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_RBLMAX key " << Keys[i] << endl; }
+     if (CVEC_RKACSQ[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_RKACSQ key " << Keys[i] << endl; }
+     if (CVEC_RNPHXT[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_RNPHXT key " << Keys[i] << endl; }
+     if (CVEC_ROZIAH[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_ROZIAH key " << Keys[i] << endl; }
+     if (CVEC_SDRAZA[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_SDRAZA key " << Keys[i] << endl; }
+     if (CVEC_ZLDXKA[i]->val() != i) { cerr <<  "ERROR with val check obj SGTObj_ZLDXKA key " << Keys[i] << endl; }
+   }
diff --git a/Control/StoreGate/test/SGTiming_test_def.inc b/Control/StoreGate/test/SGTiming_test_def.inc
new file mode 100644
index 0000000000000000000000000000000000000000..0298b4b123b55ab2935caf3a60e1275386c72461
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_def.inc
@@ -0,0 +1,3 @@
+static const unsigned int NTYPES { 20 };
+static const unsigned int NKEYS { 5 };
+static const unsigned int NITER { 100 };
diff --git a/Control/StoreGate/test/SGTiming_test_genV.pl b/Control/StoreGate/test/SGTiming_test_genV.pl
new file mode 100755
index 0000000000000000000000000000000000000000..ab5980e747efe1e92a4fcc123ac564ea07e2d8c6
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_genV.pl
@@ -0,0 +1,173 @@
+#!/usr/bin/perl
+
+my @chars = ("A" .. "Z");
+
+$NTYPES = 20;
+$NKEYS = 5;
+$NITER = 100;
+
+$DO_OBJGEN = 1;
+
+if ($ENV{"LCG_PLATFORM"} =~ /opt/) {
+    print "opt build - not doing assert\n";
+    $DO_ASSERT = 0;
+} else {
+    print "dbg build - doing assert\n";
+    $DO_ASSERT = 1;
+}
+
+$SEED = 12345;
+srand( $SEED );
+
+$n = 0;
+
+while ($n < $NTYPES) {
+
+    $s = randString(6);
+
+    $obn = "SGTObj_$s";
+
+    if (!defined $objs{$obn}) {
+        $objs{$obn} = $s;
+        $n ++;
+    } else {
+        print "$s is repeat\n";
+        $nn ++;
+    }
+}
+
+print "Generated $n classes\n";
+
+
+if ($DO_OBJGEN) {
+    open(OUT, ">SGTiming_test_objs.h");
+    
+    print OUT "#ifndef STOREGATE_SGTEST_OBJS_H\n";
+    print OUT "#define STOREGATE_SGTEST_OBJS_H 1\n";
+    
+    foreach $c (sort keys %objs) {
+        $X = createClass($c);
+        print OUT "$X\n";
+    }
+    
+    print OUT "#include \"SGTools/CLASS_DEF.h\"\n";
+    
+    print "generating $n CLIDs: ";
+    $i = 1;
+    foreach $c (sort keys %objs) {
+        print "$i ";
+        $CLID = `clid -m $c`;
+        print OUT $CLID;
+        $i++;
+    }
+    print "\n";
+    
+    print OUT "#endif\n";
+    
+    close(OUT);
+}
+
+open (OUT, ">SGTiming_test_def.inc");
+print OUT "static const unsigned int NTYPES { $NTYPES };\n";
+print OUT "static const unsigned int NKEYS { $NKEYS };\n";
+print OUT "static const unsigned int NITER { $NITER };\n";
+close (OUT);    
+
+open (OUT, ">SGTiming_test_ptr.inc");
+print OUT "   vector<string> Keys;\n";
+print OUT "   for (size_t i=0; i<$NKEYS; ++i)\n";
+print OUT "       Keys.push_back( \"key_\" + to_string(i) );\n";
+foreach $c (sort keys %objs) {
+    $s = $objs{$c};
+
+    print OUT "   std::vector<" . $c . "*> VEC_" . $s . ";\n";
+    print OUT "   std::vector<const " . $c . "*> CVEC_" . $s . ";\n";
+    print OUT "   CVEC_$s.resize($NKEYS);\n";
+    print OUT "   for (size_t i=0; i<$NKEYS; ++i)\n";
+    print OUT "       VEC_$s.push_back( new $c(i) );\n";
+
+}
+close (OUT);
+
+
+open (OUT, ">SGTiming_test_rec.inc");
+print OUT "   for (size_t i=0; i<$NKEYS; ++i) {\n";
+foreach $c (sort keys %objs) {
+    $s = $objs{$c};
+
+    if ($DO_ASSERT) {
+        print OUT "      assert(pSG->record(VEC_" . $s. "[i], Keys[i]).isSuccess());\n";
+    } else {
+        print OUT "      pSG->record(VEC_" . $s. "[i], Keys[i]).ignore();\n";
+    }
+}
+print OUT "   }\n";
+close (OUT);
+
+
+open (OUT, ">SGTiming_test_ret.inc");
+print OUT "   for (size_t i=0; i<$NKEYS; ++i) {\n";
+foreach $c (sort keys %objs) {
+    $s = $objs{$c};
+
+    if ($DO_ASSERT) {
+        print OUT "      assert(pSG->retrieve(CVEC_". $s ."[i], Keys[i]).isSuccess());\n";
+    } else {
+        print OUT "      pSG->retrieve(CVEC_". $s ."[i], Keys[i]).ignore();\n";
+    }
+}
+print OUT "   }\n";
+close (OUT);
+
+open (OUT, ">SGTiming_test_chk.inc");
+print OUT "   for (int i=0; i<$NKEYS; ++i) {\n";
+foreach $c (sort keys %objs) {
+    $s = $objs{$c};
+    if ($DO_ASSERT) {
+        print OUT "      assert (CVEC_" . $s . "[i]->val() == i);\n";
+    } else {
+        print OUT "     if (CVEC_" . $s . "[i]->val() != i) { cerr <<  \"ERROR with val check obj $c key \" << Keys[i] << endl; }\n";
+    }
+}
+print OUT "   }\n";
+close (OUT);
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+sub randString {
+    my ($l,@chars) = @_ if @_;
+    my ($s);
+
+    $l = 8 unless $l;
+    @chars = ("A" .. "Z") unless @chars;
+
+    $s .= $chars [ rand @chars ] for 1 .. $l;
+
+    return $s;
+}
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+
+sub createClass {
+    my ($n) = @_ if @_;
+    my ($X);
+
+    if (!defined $n) {
+        print "ERROR: need a class name\n";
+        exit(1);
+    }
+
+    $X  = "class $n {\n";
+    $X .= "public:\n";
+    $X .= "   $n(){};\n";
+    $X .= "   $n(int i):m_i(i){};\n";
+    $X .= "   virtual ~$n(){};\n";
+    $X .= "   void val(const int& i) { m_i = i; }\n";
+    $X .= "   int  val() const { return m_i; }\n";
+    $X .= "private:\n";
+    $X .= "   int m_i{0};\n";
+    $X .= "};\n";
+
+    return $X;
+}
+
diff --git a/Control/StoreGate/test/SGTiming_test_objs.h b/Control/StoreGate/test/SGTiming_test_objs.h
new file mode 100644
index 0000000000000000000000000000000000000000..601c1555ebe27d38e753f00c0be784bf70344186
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_objs.h
@@ -0,0 +1,248 @@
+/*
+  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+*/
+
+#ifndef STOREGATE_SGTEST_OBJS_H
+#define STOREGATE_SGTEST_OBJS_H 1
+class SGTObj_ATNGGE {
+public:
+   SGTObj_ATNGGE(){};
+   SGTObj_ATNGGE(int i):m_i(i){};
+   virtual ~SGTObj_ATNGGE(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_BJBLBR {
+public:
+   SGTObj_BJBLBR(){};
+   SGTObj_BJBLBR(int i):m_i(i){};
+   virtual ~SGTObj_BJBLBR(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_BKTYOQ {
+public:
+   SGTObj_BKTYOQ(){};
+   SGTObj_BKTYOQ(int i):m_i(i){};
+   virtual ~SGTObj_BKTYOQ(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_DPGYLG {
+public:
+   SGTObj_DPGYLG(){};
+   SGTObj_DPGYLG(int i):m_i(i){};
+   virtual ~SGTObj_DPGYLG(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_EYDAJG {
+public:
+   SGTObj_EYDAJG(){};
+   SGTObj_EYDAJG(int i):m_i(i){};
+   virtual ~SGTObj_EYDAJG(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_EYMPLC {
+public:
+   SGTObj_EYMPLC(){};
+   SGTObj_EYMPLC(int i):m_i(i){};
+   virtual ~SGTObj_EYMPLC(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_FXFSTX {
+public:
+   SGTObj_FXFSTX(){};
+   SGTObj_FXFSTX(int i):m_i(i){};
+   virtual ~SGTObj_FXFSTX(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_HARVAQ {
+public:
+   SGTObj_HARVAQ(){};
+   SGTObj_HARVAQ(int i):m_i(i){};
+   virtual ~SGTObj_HARVAQ(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_HCVLPV {
+public:
+   SGTObj_HCVLPV(){};
+   SGTObj_HCVLPV(int i):m_i(i){};
+   virtual ~SGTObj_HCVLPV(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_JWKFRN {
+public:
+   SGTObj_JWKFRN(){};
+   SGTObj_JWKFRN(int i):m_i(i){};
+   virtual ~SGTObj_JWKFRN(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_NLDRUX {
+public:
+   SGTObj_NLDRUX(){};
+   SGTObj_NLDRUX(int i):m_i(i){};
+   virtual ~SGTObj_NLDRUX(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_OBMCVK {
+public:
+   SGTObj_OBMCVK(){};
+   SGTObj_OBMCVK(int i):m_i(i){};
+   virtual ~SGTObj_OBMCVK(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_PVVIGB {
+public:
+   SGTObj_PVVIGB(){};
+   SGTObj_PVVIGB(int i):m_i(i){};
+   virtual ~SGTObj_PVVIGB(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_QKXILL {
+public:
+   SGTObj_QKXILL(){};
+   SGTObj_QKXILL(int i):m_i(i){};
+   virtual ~SGTObj_QKXILL(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_RBLMAX {
+public:
+   SGTObj_RBLMAX(){};
+   SGTObj_RBLMAX(int i):m_i(i){};
+   virtual ~SGTObj_RBLMAX(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_RKACSQ {
+public:
+   SGTObj_RKACSQ(){};
+   SGTObj_RKACSQ(int i):m_i(i){};
+   virtual ~SGTObj_RKACSQ(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_RNPHXT {
+public:
+   SGTObj_RNPHXT(){};
+   SGTObj_RNPHXT(int i):m_i(i){};
+   virtual ~SGTObj_RNPHXT(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_ROZIAH {
+public:
+   SGTObj_ROZIAH(){};
+   SGTObj_ROZIAH(int i):m_i(i){};
+   virtual ~SGTObj_ROZIAH(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_SDRAZA {
+public:
+   SGTObj_SDRAZA(){};
+   SGTObj_SDRAZA(int i):m_i(i){};
+   virtual ~SGTObj_SDRAZA(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+class SGTObj_ZLDXKA {
+public:
+   SGTObj_ZLDXKA(){};
+   SGTObj_ZLDXKA(int i):m_i(i){};
+   virtual ~SGTObj_ZLDXKA(){};
+   void val(const int& i) { m_i = i; }
+   int  val() const { return m_i; }
+private:
+   int m_i{0};
+};
+
+#include "SGTools/CLASS_DEF.h"
+CLASS_DEF( SGTObj_ATNGGE , 146467055 , 1 )
+CLASS_DEF( SGTObj_BJBLBR , 10968191 , 1 )
+CLASS_DEF( SGTObj_BKTYOQ , 111600905 , 1 )
+CLASS_DEF( SGTObj_DPGYLG , 140833718 , 1 )
+CLASS_DEF( SGTObj_EYDAJG , 242381435 , 1 )
+CLASS_DEF( SGTObj_EYMPLC , 211630903 , 1 )
+CLASS_DEF( SGTObj_FXFSTX , 218610146 , 1 )
+CLASS_DEF( SGTObj_HARVAQ , 34625046 , 1 )
+CLASS_DEF( SGTObj_HCVLPV , 130711858 , 1 )
+CLASS_DEF( SGTObj_JWKFRN , 10999691 , 1 )
+CLASS_DEF( SGTObj_NLDRUX , 1867506 , 1 )
+CLASS_DEF( SGTObj_OBMCVK , 12049043 , 1 )
+CLASS_DEF( SGTObj_PVVIGB , 220387151 , 1 )
+CLASS_DEF( SGTObj_QKXILL , 88801900 , 1 )
+CLASS_DEF( SGTObj_RBLMAX , 55184527 , 1 )
+CLASS_DEF( SGTObj_RKACSQ , 206564 , 1 )
+CLASS_DEF( SGTObj_RNPHXT , 159096137 , 1 )
+CLASS_DEF( SGTObj_ROZIAH , 232899152 , 1 )
+CLASS_DEF( SGTObj_SDRAZA , 102364564 , 1 )
+CLASS_DEF( SGTObj_ZLDXKA , 149547367 , 1 )
+#endif
diff --git a/Control/StoreGate/test/SGTiming_test_ptr.inc b/Control/StoreGate/test/SGTiming_test_ptr.inc
new file mode 100644
index 0000000000000000000000000000000000000000..2331e027b15363acf274a11367f49c955a67a265
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_ptr.inc
@@ -0,0 +1,103 @@
+   vector<string> Keys;
+   for (size_t i=0; i<5; ++i)
+       Keys.push_back( "key_" + to_string(i) );
+   std::vector<SGTObj_ATNGGE*> VEC_ATNGGE;
+   std::vector<const SGTObj_ATNGGE*> CVEC_ATNGGE;
+   CVEC_ATNGGE.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_ATNGGE.push_back( new SGTObj_ATNGGE(i) );
+   std::vector<SGTObj_BJBLBR*> VEC_BJBLBR;
+   std::vector<const SGTObj_BJBLBR*> CVEC_BJBLBR;
+   CVEC_BJBLBR.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_BJBLBR.push_back( new SGTObj_BJBLBR(i) );
+   std::vector<SGTObj_BKTYOQ*> VEC_BKTYOQ;
+   std::vector<const SGTObj_BKTYOQ*> CVEC_BKTYOQ;
+   CVEC_BKTYOQ.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_BKTYOQ.push_back( new SGTObj_BKTYOQ(i) );
+   std::vector<SGTObj_DPGYLG*> VEC_DPGYLG;
+   std::vector<const SGTObj_DPGYLG*> CVEC_DPGYLG;
+   CVEC_DPGYLG.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_DPGYLG.push_back( new SGTObj_DPGYLG(i) );
+   std::vector<SGTObj_EYDAJG*> VEC_EYDAJG;
+   std::vector<const SGTObj_EYDAJG*> CVEC_EYDAJG;
+   CVEC_EYDAJG.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_EYDAJG.push_back( new SGTObj_EYDAJG(i) );
+   std::vector<SGTObj_EYMPLC*> VEC_EYMPLC;
+   std::vector<const SGTObj_EYMPLC*> CVEC_EYMPLC;
+   CVEC_EYMPLC.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_EYMPLC.push_back( new SGTObj_EYMPLC(i) );
+   std::vector<SGTObj_FXFSTX*> VEC_FXFSTX;
+   std::vector<const SGTObj_FXFSTX*> CVEC_FXFSTX;
+   CVEC_FXFSTX.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_FXFSTX.push_back( new SGTObj_FXFSTX(i) );
+   std::vector<SGTObj_HARVAQ*> VEC_HARVAQ;
+   std::vector<const SGTObj_HARVAQ*> CVEC_HARVAQ;
+   CVEC_HARVAQ.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_HARVAQ.push_back( new SGTObj_HARVAQ(i) );
+   std::vector<SGTObj_HCVLPV*> VEC_HCVLPV;
+   std::vector<const SGTObj_HCVLPV*> CVEC_HCVLPV;
+   CVEC_HCVLPV.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_HCVLPV.push_back( new SGTObj_HCVLPV(i) );
+   std::vector<SGTObj_JWKFRN*> VEC_JWKFRN;
+   std::vector<const SGTObj_JWKFRN*> CVEC_JWKFRN;
+   CVEC_JWKFRN.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_JWKFRN.push_back( new SGTObj_JWKFRN(i) );
+   std::vector<SGTObj_NLDRUX*> VEC_NLDRUX;
+   std::vector<const SGTObj_NLDRUX*> CVEC_NLDRUX;
+   CVEC_NLDRUX.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_NLDRUX.push_back( new SGTObj_NLDRUX(i) );
+   std::vector<SGTObj_OBMCVK*> VEC_OBMCVK;
+   std::vector<const SGTObj_OBMCVK*> CVEC_OBMCVK;
+   CVEC_OBMCVK.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_OBMCVK.push_back( new SGTObj_OBMCVK(i) );
+   std::vector<SGTObj_PVVIGB*> VEC_PVVIGB;
+   std::vector<const SGTObj_PVVIGB*> CVEC_PVVIGB;
+   CVEC_PVVIGB.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_PVVIGB.push_back( new SGTObj_PVVIGB(i) );
+   std::vector<SGTObj_QKXILL*> VEC_QKXILL;
+   std::vector<const SGTObj_QKXILL*> CVEC_QKXILL;
+   CVEC_QKXILL.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_QKXILL.push_back( new SGTObj_QKXILL(i) );
+   std::vector<SGTObj_RBLMAX*> VEC_RBLMAX;
+   std::vector<const SGTObj_RBLMAX*> CVEC_RBLMAX;
+   CVEC_RBLMAX.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_RBLMAX.push_back( new SGTObj_RBLMAX(i) );
+   std::vector<SGTObj_RKACSQ*> VEC_RKACSQ;
+   std::vector<const SGTObj_RKACSQ*> CVEC_RKACSQ;
+   CVEC_RKACSQ.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_RKACSQ.push_back( new SGTObj_RKACSQ(i) );
+   std::vector<SGTObj_RNPHXT*> VEC_RNPHXT;
+   std::vector<const SGTObj_RNPHXT*> CVEC_RNPHXT;
+   CVEC_RNPHXT.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_RNPHXT.push_back( new SGTObj_RNPHXT(i) );
+   std::vector<SGTObj_ROZIAH*> VEC_ROZIAH;
+   std::vector<const SGTObj_ROZIAH*> CVEC_ROZIAH;
+   CVEC_ROZIAH.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_ROZIAH.push_back( new SGTObj_ROZIAH(i) );
+   std::vector<SGTObj_SDRAZA*> VEC_SDRAZA;
+   std::vector<const SGTObj_SDRAZA*> CVEC_SDRAZA;
+   CVEC_SDRAZA.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_SDRAZA.push_back( new SGTObj_SDRAZA(i) );
+   std::vector<SGTObj_ZLDXKA*> VEC_ZLDXKA;
+   std::vector<const SGTObj_ZLDXKA*> CVEC_ZLDXKA;
+   CVEC_ZLDXKA.resize(5);
+   for (size_t i=0; i<5; ++i)
+       VEC_ZLDXKA.push_back( new SGTObj_ZLDXKA(i) );
diff --git a/Control/StoreGate/test/SGTiming_test_rec.inc b/Control/StoreGate/test/SGTiming_test_rec.inc
new file mode 100644
index 0000000000000000000000000000000000000000..2fbd32f2ce64afa2e819affa074f52928bec172d
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_rec.inc
@@ -0,0 +1,22 @@
+   for (size_t i=0; i<5; ++i) {
+      pSG->record(VEC_ATNGGE[i], Keys[i]).ignore();
+      pSG->record(VEC_BJBLBR[i], Keys[i]).ignore();
+      pSG->record(VEC_BKTYOQ[i], Keys[i]).ignore();
+      pSG->record(VEC_DPGYLG[i], Keys[i]).ignore();
+      pSG->record(VEC_EYDAJG[i], Keys[i]).ignore();
+      pSG->record(VEC_EYMPLC[i], Keys[i]).ignore();
+      pSG->record(VEC_FXFSTX[i], Keys[i]).ignore();
+      pSG->record(VEC_HARVAQ[i], Keys[i]).ignore();
+      pSG->record(VEC_HCVLPV[i], Keys[i]).ignore();
+      pSG->record(VEC_JWKFRN[i], Keys[i]).ignore();
+      pSG->record(VEC_NLDRUX[i], Keys[i]).ignore();
+      pSG->record(VEC_OBMCVK[i], Keys[i]).ignore();
+      pSG->record(VEC_PVVIGB[i], Keys[i]).ignore();
+      pSG->record(VEC_QKXILL[i], Keys[i]).ignore();
+      pSG->record(VEC_RBLMAX[i], Keys[i]).ignore();
+      pSG->record(VEC_RKACSQ[i], Keys[i]).ignore();
+      pSG->record(VEC_RNPHXT[i], Keys[i]).ignore();
+      pSG->record(VEC_ROZIAH[i], Keys[i]).ignore();
+      pSG->record(VEC_SDRAZA[i], Keys[i]).ignore();
+      pSG->record(VEC_ZLDXKA[i], Keys[i]).ignore();
+   }
diff --git a/Control/StoreGate/test/SGTiming_test_ret.inc b/Control/StoreGate/test/SGTiming_test_ret.inc
new file mode 100644
index 0000000000000000000000000000000000000000..eacad3b48520c465fb9f7301651c412ce52927cc
--- /dev/null
+++ b/Control/StoreGate/test/SGTiming_test_ret.inc
@@ -0,0 +1,22 @@
+   for (size_t i=0; i<5; ++i) {
+      pSG->retrieve(CVEC_ATNGGE[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_BJBLBR[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_BKTYOQ[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_DPGYLG[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_EYDAJG[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_EYMPLC[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_FXFSTX[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_HARVAQ[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_HCVLPV[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_JWKFRN[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_NLDRUX[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_OBMCVK[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_PVVIGB[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_QKXILL[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_RBLMAX[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_RKACSQ[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_RNPHXT[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_ROZIAH[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_SDRAZA[i], Keys[i]).ignore();
+      pSG->retrieve(CVEC_ZLDXKA[i], Keys[i]).ignore();
+   }