Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-02-10 12:13:09


"christopher diggins" <cdiggins_at_[hidden]> wrote in message
news:004401c50f7c$779fa640$d9958242_at_heronnest...
> 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

Why didn't you go with MACRO-less solution?

> - basic_profiler now has three policies: logging, stats, timer
> - profiler now supports: restart, stop, pause, resume, generate_report
> - fixed QueryPerformanceCounter() api bug in HighResolutionTimer

1. Logging Policy

This policy supposed ot be responsible for *how* you do logging (not what or
when). Accordingly it shoud't be event driven. It should be ... feature
driven:
log_start(...), log_finish(...) e.t.c. I don't really understand how you
intend to use your current interface.

2. Stats Policy
Fron you docs (emphasis is mine): "The stats policy is responsible for
collecting *and* reporting statistics". Did you notice 'and'? You still
tring to put two eggs into same basket. What if you want 2 different
profilers, both scoped, but first measure wall-clock time, second measure
process time?

3. Timer concept
I am not sure that boost::timer interface present the best abstraction for
Timer concept. Amoung other things I believe you also need time_type (long,
long long, int64_t, timeval e.t.c). Also using double for elapsed in general
may not be desirable also.

> I am still looking for a posix high-resolution timer. Hartmut suggested a
> couple of Posix timers which he got off of Google, which unfortunately
were
> unusable: one was GPL'ed and the other lacked source code. Gennadiy said
> there were some on the mailing list (I couldn't find ),

Look here:

http://lists.boost.org/MailArchives/boost/msg47483.php
http://lists.boost.org/MailArchives/boost-users/msg08974.php
http://lists.boost.org/MailArchives/boost/msg64458.php

Gennadiy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk