comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@acm.org>
Subject: Re: task-safe hash table?
Date: Wed, 07 Jun 2006 21:10:26 -0400
Date: 2006-06-07T21:10:26-04:00	[thread overview]
Message-ID: <uodx4jvul.fsf@acm.org> (raw)
In-Reply-To: FradnWbzpPdOix7ZnZ2dnUVZ_qmdnZ2d@comcast.com

tmoran@acm.org writes:

> with ada.calendar,
>      ada.text_io;
> procedure timeprot is
>
> <snip>

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



  reply	other threads:[~2006-06-08  1:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29 21:42 task-safe hash table? tmoran
2006-05-29 22:56 ` John
2006-05-30  0:18   ` tmoran
2006-05-30  3:50     ` John
2006-05-30  4:35       ` tmoran
2006-05-30  9:50         ` Georg Bauhaus
2006-06-01  6:32   ` Simon Wright
2006-06-01 19:30     ` tmoran
2006-06-01 20:03       ` Ludovic Brenta
2006-06-01 20:07       ` Dmitry A. Kazakov
2006-06-02  4:31         ` Jeffrey R. Carter
2006-06-02 10:36         ` Stephen Leake
2006-06-03  6:50         ` tmoran
2006-06-03 20:40           ` tmoran
2006-06-02 10:35       ` Stephen Leake
2006-06-02 20:19         ` tmoran
2006-06-03 21:10           ` M E Leypold
2006-06-04  0:23             ` tmoran
2006-06-04 12:55           ` Stephen Leake
2006-06-04 17:22             ` tmoran
2006-06-08  1:10               ` Stephen Leake [this message]
2006-06-11 13:29               ` Georg Bauhaus
2006-06-04 17:48             ` Simon Wright
2006-06-05  0:23               ` tmoran
2006-06-05 21:57           ` Steve Whalen
2006-06-06 11:10             ` Ole-Hjalmar Kristensen
2006-05-30 15:00 ` Matthew Heaney
replies disabled

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