Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Performance and Profiling help

Reply
Thread Tools

Performance and Profiling help

 
 
Chun
Guest
Posts: n/a
 
      12-24-2007
Hello,

I've written a dll and compiled with gcc in mingw environment. Running
the profiling on it I get the following output (extract). My question
is what is the first entry that is taking 47% of the time?

void std::__uninitialized_fill_n_aux<fieldptr*, unsigned int,
fieldptr>(fieldptr*, unsignd int, fieldptr const&, std::__false_type)

Any pointers on how to reduce this time? I'm guessing it has something
to do with templates and gcc. Is there a alternative std C++ library
which does this quicker? - which has support on mingw and linux.

$ gprof ama.dll gmon.out -p
Flat profile:

Each sample counts as 0.01 seconds.
% cumulative self self total
time seconds seconds calls ms/call ms/call name
43.07 0.59 0.59 78552 0.01 0.01 void
std::__uninitialized_fill_n_aux<fieldptr*, unsigned int,
fieldptr>(fieldptr*, unsignd int, fieldptr const&, std::__false_type)
7.30 0.69 0.10 279600 0.00 0.00 Ama_ExtractField
6.57 0.78 0.09
_Unwind_SjLj_Register
5.84 0.86 0.08
_Unwind_SjLj_Unregister
5.11 0.93 0.07
std::string::append(char const*, unsigned int)
3.65 0.98 0.05
std::num_put<char, std:streambuf_iterator<char,
std::char_traits<char> > >::do_put(stdstreambuf_iterator<char,
std::char_traits<char> >, std::ios_base&, char, unsigned long) const
3.65 1.03 0.05
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>::basic_string(std:string const&)

2.92 1.07 0.04 585792 0.00 0.00
std::basic_string<char, std::char_traits<char>, std::allocator<char> >
std:perator+<cha, std::char_traits<char>, std::allocator<char>
>(std::basic_string<char, std::char_traits<char>, std::allocator<char>
> const&, char const*)

2.92 1.11 0.04
std::string::assign(std::string const&)
2.92 1.15 0.04 operator
new(unsigned int)
2.19 1.18 0.03 78552 0.00 0.01
ama::addfields(int)
2.19 1.21 0.03 Ama_CmdGetRec
2.19 1.24 0.03
std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned int)
1.46 1.26 0.02 78552 0.00 0.01
std::vector<fieldptr, std::allocator<fieldptr>
>::_M_fill_assign(unsigned int, fieldptr cnst&)

1.46 1.28 0.02
std::string::_Rep::_M_destroy(std::allocator<char> const&)
1.46 1.30 0.02
std::string::reserve(unsigned int)
1.46 1.32 0.02
std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::flush()

Michael
 
Reply With Quote
 
 
 
 
Erik Wikström
Guest
Posts: n/a
 
      12-24-2007
On 2007-12-24 10:11, Chun wrote:
> Hello,
>
> I've written a dll and compiled with gcc in mingw environment. Running
> the profiling on it I get the following output (extract). My question
> is what is the first entry that is taking 47% of the time?
>
> void std::__uninitialized_fill_n_aux<fieldptr*, unsigned int,
> fieldptr>(fieldptr*, unsignd int, fieldptr const&, std::__false_type)
>
> Any pointers on how to reduce this time? I'm guessing it has something
> to do with templates and gcc. Is there a alternative std C++ library
> which does this quicker? - which has support on mingw and linux.


This if off-topic by the way. You are looking at the wrong values, the
ones you should be interested in are those in cumulative column, the
function you listed (__uninitialized_fill_n_aux) is just a helper
function used by the some standard library functions. What you should be
looking for is those functions that you call in your code, then try to
figure out a way to do the same thing with smarter usages of the same or
other functions.

--
Erik Wikström
 
Reply With Quote
 
 
 
 
Michael
Guest
Posts: n/a
 
      12-25-2007
On Dec 24, 6:28 pm, Erik Wikström <Erik-wikst...@telia.com> wrote:
> On 2007-12-24 10:11, Chun wrote:
>
> > Hello,

>
> > I've written a dll and compiled with gcc in mingw environment. Running
> > the profiling on it I get the following output (extract). My question
> > is what is the first entry that is taking 47% of the time?

>
> > void std::__uninitialized_fill_n_aux<fieldptr*, unsigned int,
> > fieldptr>(fieldptr*, unsignd int, fieldptr const&, std::__false_type)

>
> > Any pointers on how to reduce this time? I'm guessing it has something
> > to do with templates and gcc. Is there a alternative std C++ library
> > which does this quicker? - which has support on mingw and linux.

>
> This if off-topic by the way. You are looking at the wrong values, the
> ones you should be interested in are those in cumulative column, the
> function you listed (__uninitialized_fill_n_aux) is just a helper
> function used by the some standard library functions. What you should be
> looking for is those functions that you call in your code, then try to
> figure out a way to do the same thing with smarter usages of the same or
> other functions.
>
> --
> Erik Wikström


Thanks Erik. Do you know which group this question belongs to?

Michael
 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      12-25-2007
Michael wrote:
> On Dec 24, 6:28 pm, Erik Wikström <Erik-wikst...@telia.com> wrote:
>> On 2007-12-24 10:11, Chun wrote:
>>
>>> Hello,
>>> I've written a dll and compiled with gcc in mingw environment. Running
>>> the profiling on it I get the following output (extract).


>> This if off-topic by the way. You are looking at the wrong values, the
>> ones you should be interested in are those in cumulative column, the
>> function you listed (__uninitialized_fill_n_aux) is just a helper
>> function used by the some standard library functions. What you should be
>> looking for is those functions that you call in your code, then try to
>> figure out a way to do the same thing with smarter usages of the same or
>> other functions.


> Thanks Erik. Do you know which group this question belongs to?


Try gnu.g++.help
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to do synchronization profiling and RepaintManager and performance issues Dimitri Ognibene Java 0 04-25-2006 09:09 AM
Performance profiling Python code =?ISO-8859-1?Q?Andreas_R=F8sdal?= Python 2 03-24-2006 10:08 PM
Profiling/performance monitoring in win32 Russell Warren Python 0 02-17-2006 05:05 PM
Re: profiling and performance of shelves Eric S. Johansson Python 0 06-25-2004 12:55 PM
profiling and performance of shelves Eric S. Johansson Python 0 06-22-2004 06:44 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57