profile mode: statistics for vector and map
François Dumont
frs.dumont@gmail.com
Tue May 7 20:57:00 GMT 2013
IMHO we should adopt the same kind of design I have introduced for
the unordered containers that is to say a base class containing in its
constructor the call to the instance registration and in the destructor
the unregistration. This way special functions could be defaulted which
will simplify maintenance and we would never forget the registration
like in the vector constructor from initializer_list<value_type> one.
François
On 05/07/2013 08:14 PM, Gedare Bloom wrote:
> Hi,
>
> The attached patch offers a start at the Statistics aspect of
> libstdc++ profile mode. So far it implements vector and map statistics
> for size (redundant/deprecates existing vector size) and common
> operation counts. There are macros for turning on/off the vector and
> map statistics individually, e.g.
> _GLIBCXX_PROFILE_NO_VECTOR_STATISTICS and _NO_MAP_STATISTICS.
>
> Some improvements could be made still or remain for the future, such as:
> * Use the _GLIBCXX_PROFILE_STATISTICS flag to turn on/off all statistics
> * Cost heuristics or high resolution timers to get the costs of operations
> * There were some problems with iterators, though I forget the specifics.
> * More containers supported and tested.
>
> I have not done extensive testing on this version of the code. This
> work was done previously on 4.7.1 with x86_64. I made some effort to
> rebase this patch from Francois' unordered map patch. Hopefully there
> are no conflicts remaining.
>
> 2013-05-07 Gedare Bloom <gedare@rtems.org>
>
> * include/profile/impl/profiler_container_statistics.h: New.
> * include/profile/impl/profiler_vector_statistics.h: New.
> * include/profile/impl/profiler_map_statistics.h: New.
> * include/Makefile.am: Add new profile headers.
> * include/Makefile.in: Regenerate.
> * include/profile/impl/profiler.h: New macros for
> __profcxx_vector_statistics and __profcxx_map_statistics.
> * include/profile/impl/profiler_trace.h: Class and function declarations
> for std::profile::__trace_vector_statistics and
> std::profile::__trace_map_statistics.
> * include/profile/map.h: Use __profcxx_map_statistics macros.
> * include/profile/vector: Use __profcxx_vector_statistics macros.
More information about the Libstdc++
mailing list