[mlpack-svn] r13020 - mlpack/trunk/src/mlpack/core/data

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Jun 11 15:01:45 EDT 2012


Author: rcurtin
Date: 2012-06-11 15:01:45 -0400 (Mon, 11 Jun 2012)
New Revision: 13020

Modified:
   mlpack/trunk/src/mlpack/core/data/load_impl.hpp
   mlpack/trunk/src/mlpack/core/data/save_impl.hpp
Log:
Add some timers for loading and saving operations.


Modified: mlpack/trunk/src/mlpack/core/data/load_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/data/load_impl.hpp	2012-06-11 18:59:42 UTC (rev 13019)
+++ mlpack/trunk/src/mlpack/core/data/load_impl.hpp	2012-06-11 19:01:45 UTC (rev 13020)
@@ -10,6 +10,8 @@
 // In case it hasn't already been included.
 #include "load.hpp"
 
+#include <mlpack/core/util/timers.hpp>
+
 namespace mlpack {
 namespace data {
 
@@ -19,6 +21,8 @@
           bool fatal,
           bool transpose)
 {
+  Timer::Start("loading_data");
+
   // First we will try to discriminate by file extension.
   size_t ext = filename.rfind('.');
   if (ext == std::string::npos)
@@ -168,6 +172,8 @@
   if (transpose)
     matrix = trans(matrix);
 
+  Timer::Stop("loading_data");
+
   // Finally, return the success indicator.
   return success;
 }

Modified: mlpack/trunk/src/mlpack/core/data/save_impl.hpp
===================================================================
--- mlpack/trunk/src/mlpack/core/data/save_impl.hpp	2012-06-11 18:59:42 UTC (rev 13019)
+++ mlpack/trunk/src/mlpack/core/data/save_impl.hpp	2012-06-11 19:01:45 UTC (rev 13020)
@@ -19,6 +19,8 @@
           bool fatal,
           bool transpose)
 {
+  Timer::Start("saving_data");
+
   // First we will try to discriminate by file extension.
   size_t ext = filename.rfind('.');
   if (ext == std::string::npos)
@@ -126,6 +128,8 @@
     }
   }
 
+  Timer::Stop("saving_data");
+
   // Finally return success.
   return true;
 }




More information about the mlpack-svn mailing list