wprof results

Hello,

I’m trying to streamline (make it faster) a program I’ve written, so I ran sample and wprof on it, and noticed it spends the following amount of time in the following functions:

Percent
of total
time
executing function name
20.5% - compchar
15.7% - memalloc
9.6% - stkq32
5.9% - nmalloc
… …
Most of my homegrown functions were in the <2% range.

What are these particular functions and in the case of compchar and stkq32, what can I do to not spend so much time there?

Thanks for any help.


Tom Wilson

Tom Wilson <twilson@atmos.washington.edu> wrote:

Hello,

I’m trying to streamline (make it faster) a program I’ve written, so I ran sample and wprof on it, and noticed it spends the following amount of time in the following functions:

Percent
of total
time
executing function name
20.5% - compchar
15.7% - memalloc

Part of the malloc() library – this is the low level allocator.

9.6% - stkq32
5.9% - nmalloc

Part of the malloc library – not sure where along the way.

… …

Might be worth looking at your use of malloc()/free() – or whatever your
chosen allocation function is (realloc(), halloc(), calloc() all use the
same underlying code).

I don’t recognise compchar or stkq32 off-hand. (Though stkq32 might
be related to the stack checking code. You might think about trying
to compile -Wc,-s to disable stack checking and see if that eliminates
the useage of stkq32.)

-David