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-Thread: a07f3367d7,cae92f92d6a1d4b1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder2.cambriumusenet.nl!feed.tweaknews.nl!138.195.8.3.MISMATCH!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Fri, 7 Jan 2011 00:25:10 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> <1wmsukf0wglz3$.odnzonrpayly.dlg@40tude.net> <6n1c5myuf2uz$.10jl3ln7il3aq.dlg@40tude.net> <8n0mgnFv2sU1@mid.individual.net> <1n3o55xjdjr9t.1u33kb75y2jfl$.dlg@40tude.net> <8n1142Fto2U1@mid.individual.net> <1o5cbm4b1l20d$.19winbma6k5qw.dlg@40tude.net> <8n4mskF7mmU1@mid.individual.net> <8nm30fF7r9U1@mid.individual.net> <8o0p0lF94rU1@mid.individual.net> <8o4k3tFko2U1@mid.individual.net> <8o8ptdF35oU1@mid.individual.net> <8omvicFgm0U1@mid.individual.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1294381513 1648 69.95.181.76 (7 Jan 2011 06:25:13 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 7 Jan 2011 06:25:13 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 Xref: g2news2.google.com comp.lang.ada:17305 Date: 2011-01-07T00:25:10-06:00 List-Id: "Niklas Holsti" wrote in message news:8omvicFgm0U1@mid.individual.net... ... >> That's probably enough for soft real-time systems anyway; and the >> facilities are useful for profiling and the like even without any strong >> connection to reality. > > I don't see how Ada.Execution_Time would be very useful for profiling. > While it could show you which tasks are CPU hogs, it does not resolve the > execution-time consumption to subprograms or subprogram parts, which I > think would be the important information for code redesigns aiming at > improving speed. Real profilers usually do give you subprogram-level or > even statement-level information. I was thinking of "profiling" by hand, essentially by adding profiler calls to "interesting" points in the code. I have a number of packages which are designed for this purpose. My experience with subprogram level profiling is that it often changes the results too much, as the overhead of profiling can be a lot more than the overhead of calling small subprograms (like the classic Getters/Setters). Perhaps it is just the way that we do it in Janus/Ada (by adding it to Enter_Walkback/Exit_Walkback calls that occur at the entrance and exit of every subprogram [unless turned off by compiler switch or pragma], which mean you don't have to recompile anything other than the main subprogram). Instruction level profiling (which is used to provide statement profiling) is a statistical method, and that has its own problems (its possible to get into a situation where the program and profiler operate in sync, such that the profiler never sees the execution of some of the code). It's also impractical unless you have a very fast timer interrupt or a long time to run (machines have gotten too fast for the one I used to use -- it only gets a few hits before the compilations are finished...). > Of course, a profiler that collects subprogram-level execution time (per > call, for example) but does not know about Ada task preemption will > probably produce wildly wrong results. Right, and that is a problem with both my profiling packages and the Janus/Ada subprogram profiler. They both use Calendar.Clock, which is obviously oblivious to task switching. Ada.Execution_Time would be a major improvement in that respect. Randy. P.S. I think I owe you a compiler update. Did you read on our mailing list about the latest beta of Janus/Ada?