From: Tapio Kelloniemi <spam18@thack.org>
Subject: Re: The Computer Language Shootout Benchmarks
Date: Wed, 03 May 2006 17:11:28 GMT
Date: 2006-05-03T17:11:28+00:00 [thread overview]
Message-ID: <4v56g.9384$0B.2009@reader1.news.jippii.net> (raw)
In-Reply-To: 1146668114.965364.116600@j33g2000cwa.googlegroups.com
"Matthew Heaney" <mheaney@on2.com> wrote:
>Tapio Kelloniemi wrote:
>> "Matthew Heaney" <mheaney@on2.com> wrote:
>> >And why do you assume that???
>>
>> Because GNAT.[Dynamic_]HTable has been designed to be extremely efficient.
>
>And why do you assume that Ada.Containers.Hashed_Maps aren't also
>designed to be extremely efficient? Why would the designer do it any
>other way?
To support some Ada features (such as controlled types) or to increase safety
with additional run-time checks. This is of course how a standard library
implementation must behave, but some particular hash table implemetation could
drop support for controlled types and suppress all checks, if such features
woudn't be required (or were considered to be too expensive).
>> Note that this is just an assumption, I have not read the code of GNAT's
>> HTable implementation,
>
>If you haven't read the sources, then how do you know?
I expected that they had taken the same aggressive approach with Htables as
with Tables, but diving into the code reveals that this is not the case (at
least not with the Simple_Htable). However, the Static_Htable can be more
efficient than Ada.Containers.Hashed_Maps, depending on the situation. Sorry
for misinforming.
>> it allows
>> direct access to the data structure
>
>Again, this is a specious argument, since having access to the
>underlying data structure is irrelevant. It's direct access to an
>element that's important.
>
>The standard library provides something very close to direct access: it
>allows in situ access to elements via Query_Element and Update_Element.
But if we want to get every microsecond out of it, though generally we don't
want to.
>> and it uses realloc to resize the table.
>
>Well obviously this will only work if the element type isn't
>controlled. So you're comparing apples to oranges, since the standard
>containers must support any non-limited type, including controlled type
>and discriminated types.
I was considering something that could be used in the shootout tests and I
think that support for controlled types is not needed there. But this is now
unrelevant since GNAT.HTable does not use realloc as I thought, so the only
benefit gained by using GNAT.HTable is that it reduces the number of lines of
code when there is no need to include the hash table implementation in the
code (LOCs are also measured in shootout).
--
Tapio
next prev parent reply other threads:[~2006-05-03 17:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-02 17:33 The Computer Language Shootout Benchmarks Martin Krischik
2006-05-02 18:39 ` jimmaureenrogers
2006-05-03 16:03 ` Martin Krischik
2006-05-04 16:48 ` Martin Krischik
2006-05-04 18:20 ` tmoran
2006-05-05 8:10 ` Craig Carey
2006-05-05 18:15 ` Martin Krischik
2006-05-06 11:00 ` Craig Carey
2006-05-06 19:00 ` tmoran
2006-05-06 7:00 ` igouy
2006-05-07 9:56 ` Martin Krischik
2006-05-06 6:57 ` igouy
2006-05-02 19:14 ` Gautier
2006-05-04 2:01 ` Craig Carey
2006-05-04 3:16 ` Craig Carey
2006-05-06 7:34 ` igouy
2006-05-06 11:29 ` Craig Carey
2006-05-06 16:01 ` igouy
2006-05-08 13:24 ` Marc A. Criley
2006-05-09 5:23 ` Craig Carey
2006-05-02 21:32 ` Tapio Kelloniemi
2006-05-02 22:37 ` Matthew Heaney
2006-05-03 10:12 ` Tapio Kelloniemi
2006-05-03 14:55 ` Matthew Heaney
2006-05-03 16:15 ` Martin Krischik
2006-05-03 17:11 ` Tapio Kelloniemi [this message]
2006-05-03 16:05 ` Martin Krischik
2006-05-03 0:12 ` Matthew Heaney
2006-05-03 16:05 ` Martin Krischik
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox