Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 1999-07-14 08:47:36


At 02:22 PM 7/1/99 -0500, Ed Brey wrote:

> [a suggested inline implementation of timer]
>
>This will result in much smaller and faster code: no heap use, no
extra
>indirection, trivial function calls inlined.
>
>> * Exposing clock_t means including <ctime> which includes two
>>macros. I dislike that.
>
>Me too. However, I dislike the performance hit on something that is
>often performance critical even more. Furthermore, given the
complaints
>on this server about clock_t, it appears likely that many people
will
>be replacing the "default" c_clock_impl with better ones for better
>performance, and ctime won't need to be included.

Class timer seems a good example of possible implementation
variations:

* There is a reasonable alternate portable implementation. It has
advantages Ed identifies above, but has a slight downside because it
#includes a C library header, and exposes more of the implementation.
* There are reasonable alternate implementations for specific
platforms that use non-portable hardware or operating system calls.
May be much more reliable on some platforms.

Looking at the Boost Implementation Variation paper, it seems to me
that the "Separate files" solution is called for. This means there
is the default slow but safe implementation, and then the
distribution file can contain as many alternate implementation as
people care to send in. The critical requirement is that these
alternate implementations follow the documented interface.

--Beman

------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/boost
http://www.egroups.com - Simplifying group communications


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