From: Bob Duff <bobduff@theworld.com>
Subject: Re: Implementing character sets for Wide_Character
Date: Fri, 06 Mar 2015 17:21:19 -0500
Date: 2015-03-06T17:21:19-05:00 [thread overview]
Message-ID: <87y4n9938g.fsf@theworld.com> (raw)
In-Reply-To: mdd4t3$p74$1@news.albasani.net
Martin Trenkmann <martin.trenkmann@posteo.de> writes:
> Thanks for pointing out that both methods may consume the same amount of
> memory. So at the end it's up to the compiler and caching effects which version
> runs faster.
Compilers can do all sorts of things, which is one reason why it's wise
to measure.
But I doubt any Ada compiler would generate a jump table for the case
statement you showed in your OP. That would be a 2**16-entry table with
almost all of the entries duplicated. I'd expect something more like a
subtract, a compare, and a conditional jump. And the function should be
inlined.
> ...At the meantime, however, I was made aware of package
> Ada.Strings.Wide_Maps that I will use now.
And keep using it, unless you discover efficiency problems. ;-)
- Bob
next prev parent reply other threads:[~2015-03-06 22:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 18:01 Implementing character sets for Wide_Character Martin Trenkmann
2015-03-06 18:15 ` Bob Duff
2015-03-06 21:02 ` Martin Trenkmann
2015-03-06 18:18 ` G.B.
2015-03-06 21:06 ` Martin Trenkmann
2015-03-06 22:21 ` Bob Duff [this message]
2015-03-06 19:24 ` Dmitry A. Kazakov
2015-03-06 21:48 ` Jeffrey Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox