This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [profile-stdlib] PATCH: Add three diagnostics and implement cost factor parameterization
- From: Silvius Rus <rus at google dot com>
- To: Changhee Jung <haemil99 at gmail dot com>, Benjamin Kosnik <bkoz at redhat dot com>
- Cc: libstdc++ at gcc dot gnu dot org, Nate Clark <ntclark at cc dot gatech dot edu>
- Date: Mon, 7 Dec 2009 14:15:08 -0800
- Subject: Re: [profile-stdlib] PATCH: Add three diagnostics and implement cost factor parameterization
- References: <86887f550912061938t5fcc8c8dv135ce56b92d87433@mail.gmail.com>
On Sun, Dec 6, 2009 at 7:38 PM, Changhee Jung <haemil99@gmail.com> wrote:
> Hello libstdc++ maintainers,
>
Hello maintainers,
Can this still make it to 4.5, given that it affects only the profile
mode? If so, could you review it as a patch to trunk instead of
branch? There are no other changes on the profile-stdlib branch since
the last merge to trunk, except for very minor fixes.
Thank you,
Silvius
> 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
> environment variables.
>
> 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.
>
> Thank you,
> Changhee
>