diff OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp @ 1751:946eb7200b82

FastParseVector usage + timing instrumentation guarded by STONE_TIME_BLOCKING_OPS
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 22 Feb 2021 14:57:01 +0100
parents 9ac2a65d4172
children 4ee11b8773e2
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp	Mon Feb 22 14:56:06 2021 +0100
+++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp	Mon Feb 22 14:57:01 2021 +0100
@@ -28,6 +28,10 @@
 
 #include <Toolbox.h>
 
+#if STONE_TIME_BLOCKING_OPS
+# include <boost/date_time/posix_time/posix_time.hpp>
+#endif
+
 #include <algorithm>
 
 namespace OrthancStone
@@ -187,6 +191,10 @@
     
     virtual void Handle(const OrthancRestApiCommand::SuccessMessage& message) ORTHANC_OVERRIDE
     {
+#if STONE_TIME_BLOCKING_OPS
+      boost::posix_time::ptime timerStart = boost::posix_time::microsec_clock::universal_time();
+#endif
+
       DicomStructureSetLoader& loader = GetLoader<DicomStructureSetLoader>();
 
       // Set the actual structure set content
@@ -219,6 +227,13 @@
       }
 
       loader.RetrieveReferencedSlices(nonEmptyInstances);
+#if STONE_TIME_BLOCKING_OPS
+      boost::posix_time::ptime timerEnd = boost::posix_time::microsec_clock::universal_time();
+      boost::posix_time::time_duration duration = timerEnd - timerStart;
+      int64_t durationMs = duration.total_milliseconds();
+      LOG(WARNING) << "DicomStructureSetLoader::LoadStructure::Handle took " << durationMs << " ms";
+#endif
+
     }
 
     void SetDefaultStructureVisibility()