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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,86b57370403509bc X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!a20g2000vbc.googlegroups.com!not-for-mail From: dhenry Newsgroups: comp.lang.ada Subject: Re: Disabling string evaluation in a logging system Date: Wed, 19 May 2010 00:47:39 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 80.156.46.53 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1274255259 5604 127.0.0.1 (19 May 2010 07:47:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 19 May 2010 07:47:39 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a20g2000vbc.googlegroups.com; posting-host=80.156.46.53; posting-account=EZVF2goAAABmd4nprEqIYBBoiiKbAL2e User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.9.0.19) Gecko/2010040116 Ubuntu/9.04 (jaunty) Firefox/3.0.19,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:11745 Date: 2010-05-19T00:47:39-07:00 List-Id: On 18 mai, 20:40, tmo...@acm.org wrote: > =A0 =A0So write your own specialized preprocessor that adds the "if" > statement to calls on log.write before handing the result to the compiler= . That may be a possible solution to my problem. > =A0 As usual with "optimizations", the first question is "will this > obfuscation actually save significant time?". =A0If the answer, > surprisingly, is "yes", then find the few places where log.write > is actually called millions of times and manually insert the "if" > test in those places. Yes, this may be seen as a premature optimization. I was just looking for a possible opportunity (and maybe learn some new Ada tricks). If I encounter some real performance issues, I'll probably do that. I prefer something "elegant" (code readability and maintenance is important) but with "poor" performances, as long as it respects performance requirements.