Table Of Contents

This Page

Profiling Duplication

TODO

OpticksProfile uses Timer internally, but other bare usage remains.

  • move persisted OpticksProfile contents into a folder named OpticksProfile at top level and duplicate that within datestamped folders, following the old pattern of Timer
  • get rid of legacy direct usage of npy/Timer

OpticksProfile

Canonical m_profile instance resides in Opticks instance, and is created with it. Used from Opticks via OK_PROFILE:

39 #define OK_PROFILE(s) \
40     { \
41        if(m_ok)\
42        {\
43           m_ok->profile((s)) ;\
44        }\
45     }

215 template <typename T>
216 void Opticks::profile(T label)
221 void Opticks::dumpProfile(const char* msg, const char* startswith, const char* spacewith, double tcut)
225 void Opticks::saveProfile()
 217 template <typename T>
 218 void Opticks::profile(T label)
 219 {
 220     m_profile->stamp<T>(label, m_tagoffset);
 221    // m_tagoffset is set by Opticks::makeEvent
 222 }





simon:opticks blyth$ opticks-find OK_PROFILE | wc -l
      38

Profile stamps are persisted in ini and npy, holding the same information:

/tmp/blyth/opticks/evt/boolean/torch
simon:torch blyth$ l
total 40
drwxr-xr-x  12 blyth  wheel  408 Mar  4 14:09 -1
drwxr-xr-x  23 blyth  wheel  782 Mar  4 14:09 1
-rw-r--r--   1 blyth  wheel  701 Mar  4 14:09 DeltaTime.ini
-rw-r--r--   1 blyth  wheel  573 Mar  4 14:09 DeltaVM.ini
-rw-r--r--   1 blyth  wheel  480 Mar  4 14:09 Opticks.npy
-rw-r--r--   1 blyth  wheel  776 Mar  4 14:09 Time.ini
-rw-r--r--   1 blyth  wheel  656 Mar  4 14:09 VM.ini

Looks like this is currently only done at top level, not in the date stamped folders. So only the last invokation times are available.