comp.lang.ada
 help / color / mirror / Atom feed
From: Kilgallen@eisner.decus.org.nospam (Larry Kilgallen)
Subject: Re: Profiling Gnat re. pthread_malloc, pthread_getspecific, system
Date: 23 Jun 2001 05:57:33 -0500
Date: 2001-06-23T05:57:33-05:00	[thread overview]
Message-ID: <sAjdUn9SVvKb@eisner.encompasserve.org> (raw)
In-Reply-To: 3B344689.8A79ED4F@mullum.com.au

In article <3B344689.8A79ED4F@mullum.com.au>, Charles Darcy <charlie@mullum.com.au> writes:

>     I've profiled an Ada program, which I converted from c++, so that I
> might learn why the Ada program performs worse than the c++ version
> (approx. 10 times slower). I'm using Gnat 3.13p and gprof on a Linux
> (Mandrake 8.0) machine. I've used inlining, O3 optimisation, and
> disabled all run-time checks.
> 
>     The profile results (below) seem to indicate that pthread_malloc,
> pthread_getspecific consume a large portion of processing time, but
> these functions are a mystery to me. Is there any way to reduce the
> performance cost of these functions ?

I am not familiar with your analysis tool, but I would suggest
considering whether the C++ version uses the same pthread_ calls
and uses them an equivalent number of times in a run against
some fixed input data.

Just by the name, pthread_malloc would seem it could not be any
more efficient than ordinary malloc, although it might be equal
on your platform.

>     I'm new to Ada, and afraid I may have inadvertantly used the
> language in an improper fashion, resulting in poor performance.
> My thanks to anyone who can enlighten me as to what might be done to
> eliminate any unnecessary performance overhead.

That is a possibility.  Someone familiar with Ada might be able to
look at your code and see if it resembles "C++ style" more than
Ada style.

You might also consider whether it is possible to experiment with
your program on a different Ada compiler and operating system. It
could be there is something in your algorithm that happens to hit
a weak point in GNAT.



  reply	other threads:[~2001-06-23 10:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-23  7:34 Profiling Gnat re. pthread_malloc, pthread_getspecific, system finalisation & tasking Charles Darcy
2001-06-23 10:57 ` Larry Kilgallen [this message]
2001-06-23 19:26 ` Pat Rogers
2001-06-23 20:06   ` tmoran
2001-06-25  5:25     ` Rod Kay
2001-06-25  5:42       ` Charles Darcy
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox