[stopwatches] About reducing the scope of the library

Hi, I'm not completly satisfied with the reporting interface/design I did for Boost.Stopwatches. I need to think more about the design so it can provide Locale facilities to the user. Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)? Best, Vicente

On Sep 7, 2011, at 5:35 PM, "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr> wrote:
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)?
It would be really nice to have a replacement for Boost.Timer ASAP. Perhaps it would make sense to introduce something simple as a Chrono example, and then decide how to expand it into a library later? Not sure if this answers your question. I haven't looked closely. Thanks Gordon

Le 08/09/11 04:30, Gordon Woodhull a écrit :
On Sep 7, 2011, at 5:35 PM, "Vicente J. Botet Escriba"<vicente.botet@wanadoo.fr> wrote:
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)? It would be really nice to have a replacement for Boost.Timer ASAP. Perhaps it would make sense to introduce something simple as a Chrono example, and then decide how to expand it into a library later?
I don't know what do you consider a simple example. Do this simple example report on standard output the time slapsed? Could you give one, please? This will help me a lot.
Not sure if this answers your question. I haven't looked closely.
I will be interested in your opinion. Let me know what do you think is you have time to look closely. Best, Vicente

On Sep 9, 2011, at 3:10 PM, "Vicente J. Botet Escriba" <vicente.botet@wanadoo.fr> wrote:
Le 08/09/11 04:30, Gordon Woodhull a écrit :
On Sep 7, 2011, at 5:35 PM, "Vicente J. Botet Escriba"<vicente.botet@wanadoo.fr> wrote:
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)? It would be really nice to have a replacement for Boost.Timer ASAP. Perhaps it would make sense to introduce something simple as a Chrono example, and then decide how to expand it into a library later?
I don't know what do you consider a simple example.
Oops, I meant: yes please make stopwatches a sublibrary of chrono and then see if it needs to set off on its own. All I want is a replacement for boost::timer, for writing benchmarks. I never used the progress_timer so I don't know about the reporting side of Boost.Timer, never wanted it. I want a simple class that keeps track of elapsed time so I don't have to even do one subtraction. In one quick pass of the Stopwatches documentation, I can't find anything that doesn't do automatic reporting. I figure there must be a class in there that looks a lot like boost::timer or the one in Chrono's "key is struck" example, which is what your original question must be proposing. I find Boost.Timer kind of buggy. It was reporting CPU time on Linux, so I couldn't benchmark a parallelized program. I feel it has other problems. I thought Chrono was supposed to replace it, but it's still a little verbose for this very simple task. Cheers, Gordon

Le 10/09/11 10:02, Gordon Woodhull a écrit :
On Sep 9, 2011, at 3:10 PM, "Vicente J. Botet Escriba"<vicente.botet@wanadoo.fr> wrote:
Le 08/09/11 04:30, Gordon Woodhull a écrit :
On Sep 7, 2011, at 5:35 PM, "Vicente J. Botet Escriba"<vicente.botet@wanadoo.fr> wrote:
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)? It would be really nice to have a replacement for Boost.Timer ASAP. Perhaps it would make sense to introduce something simple as a Chrono example, and then decide how to expand it into a library later? I don't know what do you consider a simple example. Oops, I meant: yes please make stopwatches a sublibrary of chrono and then see if it needs to set off on its own.
Yes, this is a good idea.
All I want is a replacement for boost::timer, for writing benchmarks. I never used the progress_timer so I don't know about the reporting side of Boost.Timer, never wanted it. I want a simple class that keeps track of elapsed time so I don't have to even do one subtraction.
In one quick pass of the Stopwatches documentation, I can't find anything that doesn't do automatic reporting. I figure there must be a class in there that looks a lot like boost::timer or the one in Chrono's "key is struck" example, which is what your original question must be proposing. I guess this is due to the fact I used everytime the reporting facilities. The equivalent of the timer class is stopwatch. Here follows un example
using namespace boost::chrono; using namespace boost::stopwatches; int f1(long j) { stopwatch|| <mailbox:///Users/viboes/Library/Thunderbird/Profiles/7k7xdbkm.default/Mail/pop.orange.fr/Sent?number=319244&part=1.2.2&filename=stopwatches.html><system_clock> sw; for ( long i = 0; i < j; ++i ) std::sqrt( 123.456L ); // burn some time return milliseconds(sw.elapsed()).count(); // retun the number of milliseconds } elapsed() returns the elapsed time since the stopwatch was created. Does this respond to your expectations?
I find Boost.Timer kind of buggy. It was reporting CPU time on Linux, so I couldn't benchmark a parallelized program. I feel it has other problems. I thought Chrono was supposed to replace it, but it's still a little verbose for this very simple task.
My first proposal of Boost.Chrono included Stopwatches, but some on this list sugested that i would be better to split the library :( If no body is agains I will move Boost.Stopwatches to the namespace boost::chrono, remove the reporting facilities, and find a date for a review. Best, Vicente

On Sep 10, 2011, at 11:06 AM, Vicente J. Botet Escriba wrote:
Does this respond to your expectations?
Yes!
My first proposal of Boost.Chrono included Stopwatches, but some on this list sugested that i would be better to split the library :(
That design still has merit, but -
If no body is agains I will move Boost.Stopwatches to the namespace boost::chrono, remove the reporting facilities, and find a date for a review.
My point was that since you own Chrono you can add whatever you want to it. So you could get something distributed now and see about a review later. But perhaps I'm the only one thinking the need for a Boost.Timer replacement is urgent. Cheers, Gordon

My first proposal of Boost.Chrono included Stopwatches, but some on this list sugested that i would be better to split the library :(
That design still has merit, but -
If no body is agains I will move Boost.Stopwatches to the namespace boost::chrono, remove the reporting facilities, and find a date for a review.
My point was that since you own Chrono you can add whatever you want to it. So you could get something distributed now and see about a review later.
But perhaps I'm the only one thinking the need for a Boost.Timer replacement is urgent.
Nod. Sounds like an important addition to me. IMO a small addition of a stopwatch could be done without a formal review - maybe just post the design and get feedback? But something like: template <class Clock> struct stopwatch { void reset(); double elapsed(); }; would seem hard to go wrong with? OK arguably the result of elapsed() should be a duration, but that makes it harder to use.... BTW I spotted a typo in your docs: "The standard defines tree system-wide clocks" ^^ John.

Le 11/09/11 11:17, John Maddock a écrit :
My first proposal of Boost.Chrono included Stopwatches, but some on this list sugested that i would be better to split the library :(
That design still has merit, but -
If no body is agains I will move Boost.Stopwatches to the namespace boost::chrono, remove the reporting facilities, and find a date for a review.
My point was that since you own Chrono you can add whatever you want to it. So you could get something distributed now and see about a review later.
But perhaps I'm the only one thinking the need for a Boost.Timer replacement is urgent.
Nod. Sounds like an important addition to me.
IMO a small addition of a stopwatch could be done without a formal review - maybe just post the design and get feedback?
I would prefer a review.
But something like:
template <class Clock> struct stopwatch { void reset(); double elapsed(); };
would seem hard to go wrong with? OK arguably the result of elapsed() should be a duration, but that makes it harder to use....
Why do you think it is harder to use? Could you give an example when returning double will be clearer? Which will be the units of this double?
BTW I spotted a typo in your docs:
"The standard defines tree system-wide clocks" ^^
Thanks, Vicente

On Wed, Sep 7, 2011 at 5:35 PM, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr> wrote:
Hi,
I'm not completly satisfied with the reporting interface/design I did for Boost.Stopwatches. I need to think more about the design so it can provide Locale facilities to the user.
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)?
Sigh. Like Gordon and John, I want a replacement for Boost Timer. Now. See the "[system] Boost.Timer replacement" thread I'm about to post. --Beman

Le 13/09/11 17:04, Beman Dawes a écrit :
On Wed, Sep 7, 2011 at 5:35 PM, Vicente J. Botet Escriba <vicente.botet@wanadoo.fr> wrote:
Hi,
I'm not completly satisfied with the reporting interface/design I did for Boost.Stopwatches. I need to think more about the design so it can provide Locale facilities to the user.
Do you think that it is worth proposing an addition to Boost.Chrono that provides only stopwatches (without reporting)? Sigh. Like Gordon and John, I want a replacement for Boost Timer. Now.
If I understand your concern, reporting is a must have for Stopwatches. As I said, the reporting part of Boost.Stopwatch is not ready. I'm working hard to replace it, but I don't think I will have something ready for review before 2 months, but who knows :) Best, Vicente
participants (4)
-
Beman Dawes
-
Gordon Woodhull
-
John Maddock
-
Vicente J. Botet Escriba