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: 103376,4cf1fd41f64f8f02 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: task-safe hash table? References: From: Stephen Leake Date: Wed, 07 Jun 2006 21:10:26 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:QcEIjb5IsCkN1+rR01hSQtkRj54= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: acf8c44877910e73ae4a425912 Xref: g2news2.google.com comp.lang.ada:4706 Date: 2006-06-07T21:10:26-04:00 List-Id: tmoran@acm.org writes: > with ada.calendar, > ada.text_io; > procedure timeprot is > > This looks like a reasonable test. Here's my results with GNAT 5.04 on Windows XP (I only kept the second run; the first loads cache): gnatmake -O0 ./timeprot.exe a 0.025702000 mics b 0.026539000 mics c 0.029333000 mics prot.a 4.420673000 mics prot.b 0.504533000 mics prot.c 0.423238000 mics gnatmake -O2 ./timeprot.exe a 0.023188000 mics b 0.022629000 mics c 0.023187000 mics prot.a 7.770820000 mics prot.b 0.576610000 mics prot.c 0.529676000 mics Interesting that it is slower with -02! AdaCore recommends against using -O3 because it includes "potentially unsafe and disruptive optimizations". But here it is anyway: gnatmake -O3 ./timeprot.exe a 0.014806000 mics b 0.014527000 mics c 0.004470000 mics prot.a 7.431950000 mics prot.b 0.619911000 mics prot.c 0.529676000 mics There is some variation from run to run. But this is pretty convincing that a protected function call is 25 times slower than a plain function call. I'll see what AdaCore has to say. And I'll try it on Lynx, which is more real-time than Windows or Linux :). -- -- Stephe