RE: [boost] Latest version of the profiler

-----Original Message----- Subject: [boost] Latest version of the profiler
I have updated the profiler library to take into account many of the excellent suggestions. I have tried to give acknowledgements where it is due, please let me know if I have overlooked anyone.
The latest version is at: http://www.cdiggins.com/profiler
The major changes are: - defining BOOST_PROFILING_OFF causes all member calls to become empty statements - basic_profiler now has three policies: logging, stats, timer - profiler now supports: restart, stop, pause, resume, generate_report - fixed QueryPerformanceCounter() api bug in HighResolutionTimer
[Brian Braatz] Hahahahaha " Macros were avoided because everyone knows macros are evil, unless we are the ones writing them." I LOVE THIS LINE. Please keep it in :) On a serious note though, with your lib done the way it is , if someone WANTS macros, there is nothing preventing them from having them. I for example- MIGHT take your library and stuff __FILE__ __LINE__ into the id. For this I would use a macro. This is also why I made the request for the char*name type to be a template param. I may want to plop in my own struct that has the __FILE__ and __LINE__ in it.

----- Original Message ----- From: "Brian Braatz" <brianb@rmtg.com>
[Brian Braatz] Hahahahaha
" Macros were avoided because everyone knows macros are evil, unless we are the ones writing them."
I LOVE THIS LINE. Please keep it in :)
Thanks :)
On a serious note though, with your lib done the way it is , if someone WANTS macros, there is nothing preventing them from having them.
I for example- MIGHT take your library and stuff __FILE__ __LINE__ into the id. For this I would use a macro. This is also why I made the request for the char*name type to be a template param. I may want to plop in my own struct that has the __FILE__ and __LINE__ in it.
The current implementation uses a map<string, pair<int, double> > for gathering of stats. This makes it easy to access data by profile name and to accumulate data for a named profile. Of course this could be rewritten, but my goal is to do as little work as possible. ;) What if instead you wrote: #define PROFILE(TKN) BOOST_PROFILE(#TKN##__FILE__##__LINE__) Or better yet: #ifndef BOOST_PROFILING_OFF map<string, pair<int, string> > my_map; #endif #ifndef BOOST_PROFILING_OFF #define PROFILE(TKN) mymap[#TKN] = pair<int,string>(__LINE__, __FILE__); BOOST_PROFILE(#TKN); #else #define PROFILE(TKN) /* */ #endif Would these be acceptable alternatives? Christopher Diggins Object Oriented Template Library (OOTL) http://www.ootl.org
participants (2)
-
Brian Braatz
-
christopher diggins