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,FREEMAIL_FROM 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!postnews.google.com!h76g2000cwa.googlegroups.com!not-for-mail From: "Steve Whalen" Newsgroups: comp.lang.ada Subject: Re: task-safe hash table? Date: 5 Jun 2006 14:57:16 -0700 Organization: http://groups.google.com Message-ID: <1149544635.972350.169450@h76g2000cwa.googlegroups.com> References: NNTP-Posting-Host: 68.238.134.29 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1149544641 24662 127.0.0.1 (5 Jun 2006 21:57:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 5 Jun 2006 21:57:21 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h76g2000cwa.googlegroups.com; posting-host=68.238.134.29; posting-account=GBMmzA0AAABrZ0dHOASa3b2Cdf-RliH9 Xref: g2news2.google.com comp.lang.ada:4688 Date: 2006-06-05T14:57:16-07:00 List-Id: tmoran@acm.org wrote: > > > the overhead of making it Protected would probably kill the gain. > > > > What "overhead"? > In a trivial single-tasking test program on my machine, a call to a > Protected function compiled with Gnat 3.15p -O2 takes > 0.304697000 mics while a call to a regular function takes > 0.022779000 microseconds. > Using -O3, it's > 0.291347000 mics while a call to a regular function takes > 0.001893000 microseconds. When I run your program on a Linux Debian Sarge server with a vanilla install of GNAT 3.15p with a slow 450mhz Pentium (and no other load) I get: ==> compiled with no optimization <== a 0.076000000 mics b 0.075000000 mics c 0.073000000 mics prot.a 3.590000000 mics prot.b 2.480000000 mics prot.c 1.710000000 mics ==> compiled with O2 optimization <== a 0.064000000 mics b 0.041000000 mics c 0.041000000 mics prot.a 3.726000000 mics prot.b 2.356000000 mics prot.c 1.586000000 mics ==> compiled with O3 optimization <== a 0.017000000 mics b 0.017000000 mics c 0.006000000 mics prot.a 3.820000000 mics prot.b 2.369000000 mics prot.c 1.865000000 mics So the relationship between optimization levels looks materially the same, as does the overhead of protected mode. Steve