It depends on the value distribution . David
On Thu, Dec 20, 2012 at 11:30 AM, Rong Xu <x...@google.com> wrote: > On Wed, Dec 19, 2012 at 5:22 PM, Rong Xu <x...@google.com> wrote: >> On Wed, Dec 19, 2012 at 5:04 PM, <davi...@google.com> wrote: >>> The change in gcov-io.h is from a different patch. >> >> sorry. here is the patch for gcov-io.h: >> >> Index: gcov-io.h >> =================================================================== >> --- gcov-io.h (revision 194562) >> +++ gcov-io.h (working copy) >> @@ -781,8 +781,8 @@ >> unused) */ >> >> unsigned n_functions; /* number of functions */ >> - const struct gcov_fn_info *const *functions; /* pointer to pointers >> - to function information */ >> + const struct gcov_fn_info **functions; /* pointer to pointers >> + to function information */ >> }; >> >> /* Information about a single imported module. */ >> @@ -988,8 +988,7 @@ >> GCOV_LINKAGE void gcov_seek (gcov_position_t /*position*/) ATTRIBUTE_HIDDEN; >> GCOV_LINKAGE void gcov_truncate (void) ATTRIBUTE_HIDDEN; >> GCOV_LINKAGE gcov_unsigned_t gcov_string_length (const char *) >> ATTRIBUTE_HIDDEN; >> -GCOV_LINKAGE unsigned gcov_gcda_file_size (struct gcov_info *, >> - struct gcov_summary *); >> +GCOV_LINKAGE unsigned gcov_gcda_file_size (struct gcov_info *); >> #else >> /* Available outside libgcov */ >> GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/, >> >>> >>> David >>> >>> >>> https://codereview.appspot.com/6968046/diff/1/gcc/gcov-io.c >>> File gcc/gcov-io.c (right): >>> >>> https://codereview.appspot.com/6968046/diff/1/gcc/gcov-io.c#newcode688 >>> gcc/gcov-io.c:688: >>> Have you compared this with this impl: >>> >>> while (x) >>> { >>> c++; >>> x&=(x-1) >>> } >>> return c; >>> >> >> I did not try this pimplier version. I can do a test on the dump speed >> and report back. > > This simpler version is about 2% slow in dumping the profiles (average > of 10 dumps). But this is not a big deal. > I'll use this this version. > > -Rong > >> >>> https://codereview.appspot.com/6968046/