[profile-stdlib] PATCH: Add three diagnostics and implement cost factor parameterization
Mon Dec 7 03:39:00 GMT 2009
Hello libstdc++ maintainers,
The attached patch implements the following in the profile-stdlib branch:
1) New diagnostics
- list-to-vector; if data is inserted at the end of the list and
iteration operation is common, vector is better.
- list-to-slist; slist is more likely to fit in a cache line due to
less memory usage.
- list-to-set; if a find operation, 'std::find', is frequently used
in the list, set is better.
2) Cost factor parameterization; constant factors of the cost models
for diagnostics can be read from a file, "libstdcxx-profile.conf" or
There is an issue related to thel instrumentation of 'std::find'.
It seems that 'bits/stl_algo.h' was modified for the parallel mode so
that its functions declared in the namespace of '_GLIBCXX_STD_P' can
be used instead of original functions in the release mode.
Currently, I did the same thing, conditional compilation stuff, to
hide the original 'find' function under its wrapper function.
This inevitably causes a modification to the original 'bits/stl_algo.h'.
Alternatively, it is possible to duplicate the 'bits/stl_algo.h' in
'profile/stl_algo.h' and modify the copy to avoid any intrusion from
the profile mode to the release mode.
It would be appreciated if you come up with a better idea to deal with this.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 88479 bytes
Desc: not available
More information about the Libstdc++