From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,70d59e24bec599dc X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-23 12:26:06 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!cyclone.swbell.net!nnrp2.sbc.net.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.ada References: <3B344689.8A79ED4F@mullum.com.au> Subject: Re: Profiling Gnat re. pthread_malloc, pthread_getspecific, system finalisation & tasking. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: Date: Sat, 23 Jun 2001 14:26:05 -0500 NNTP-Posting-Host: 208.191.184.67 X-Complaints-To: abuse@swbell.net X-Trace: nnrp2.sbc.net 993324365 208.191.184.67 (Sat, 23 Jun 2001 14:26:05 CDT) NNTP-Posting-Date: Sat, 23 Jun 2001 14:26:05 CDT Organization: SBC Internet Services Xref: archiver1.google.com comp.lang.ada:9062 Date: 2001-06-23T14:26:05-05:00 List-Id: "Charles Darcy" wrote in message news:3B344689.8A79ED4F@mullum.com.au... > Hello, > > 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. By "using inlining" do you mean pragma Inline? Did you also specify -gnatn? Is this for your own personal curiosity or for work? If the latter, let me strongly suggest you get an evaluation license from ACT so that you can do a proper comparison -- you will indeed be fighting the issues you mention at the bottom of your post and will need their help in getting meaningful results (as would be the case for any vendor). > 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 ? > > The other expensive sub-programs seem related to tasking and > controlled types, neither of which I directly use. Somehow your Ada code does not correspond to your C++ code, regarding threads.