comp.lang.ada
 help / color / mirror / Atom feed
From: Natasha Kerensikova <lithiumcat@gmail.com>
Subject: Re: Ann: Natools.Chunked_Strings, beta 1
Date: Thu, 1 Dec 2011 22:49:11 +0000 (UTC)
Date: 2011-12-01T22:49:11+00:00	[thread overview]
Message-ID: <slrnjdg12n.1lme.lithiumcat@sigil.instinctive.eu> (raw)
In-Reply-To: op.v5txidavule2fv@douda-yannick

On 2011-12-01, Yannick Duchêne <yannick_duchene@yahoo.fr> wrote:
> Le Thu, 01 Dec 2011 20:07:09 +0100, Jeffrey Carter  
><spam.jrcarter.not@spam.not.acm.org> a écrit:
>> The evil of premature optimization is the waste of effort when the  
>> optimization is unnecessary.
> Or also when optimization is at the cost of clarity (optimized  
> implementation is often less easy to understand and more error prone, as  
> it involves special cases everywhere).

That's what also I understood as "evil": when a trade-off between
optimization and clarity or simplicity or cleanness is shifted early
towards optimization. I don't consider a waste of time or effort as
"evil", only "bad" or "stupid". To reach the level of "evil" to my eyes,
it needs to be still costly after being unmasked as evil.

In the example here, in the case where I have a genuine performance
problem with Unbounded_String, and where Chunked_String turns out to be
as efficient, or slightly, that's exactly the same waste of time and
effort, without premature optimization or any evil.

Other the other hand, using an interface like String_Accumulator instead
of static calls, if it were only for performance consideration, and if
it turns out that the dynamic dispatch is doing irreparable damage to
performance, to the point of having to rewrite the thing with static
calls, then it would be evil because of the rewriting work needed repair
the code.

At least that's how I've always understood it. Re-reading the context of
Knuth's quote, "these attempts at efficiency actually have a strong
negative impact when debugging and maintenance are considered." The mere
existence of an optimized version of an existing module, that can be
plugged effortlessly into or out of the project, has no debugging or
maintenance impact at all.


Natasha



  reply	other threads:[~2011-12-01 22:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29 15:16 Ann: Natools.Chunked_Strings, beta 1 Natasha Kerensikova
2011-11-29 15:37 ` Pascal Obry
2011-11-29 16:34   ` Natasha Kerensikova
2011-11-29 17:08     ` Georg Bauhaus
2011-11-30  9:51       ` Natasha Kerensikova
2011-11-29 20:25     ` Randy Brukardt
2011-11-30 10:44     ` Yannick Duchêne (Hibou57)
2011-11-30 10:39   ` Yannick Duchêne (Hibou57)
2011-11-30 10:57     ` Dmitry A. Kazakov
2011-12-01  0:11       ` Randy Brukardt
2011-12-01  8:30         ` Dmitry A. Kazakov
2011-12-01 23:26           ` Vinzent Hoefler
2011-12-02  8:27             ` Dmitry A. Kazakov
2011-12-02  9:30               ` Georg Bauhaus
2011-12-02 13:11                 ` Dmitry A. Kazakov
2011-12-02  0:39           ` Randy Brukardt
2011-12-01  9:02         ` Yannick Duchêne (Hibou57)
2011-11-30 13:08     ` Natasha Kerensikova
2011-11-30 19:39       ` Jeffrey Carter
2011-12-01 10:57         ` Natasha Kerensikova
2011-12-01 19:07           ` Jeffrey Carter
2011-12-01 21:19             ` Yannick Duchêne (Hibou57)
2011-12-01 22:49               ` Natasha Kerensikova [this message]
2011-12-02 16:16         ` Tero Koskinen
2011-12-02 17:36           ` Adam Beneschan
2011-12-02 18:52             ` Tero Koskinen
2011-12-02 18:14           ` Yannick Duchêne (Hibou57)
2011-12-02 19:07             ` Adam Beneschan
2011-11-30 10:33 ` Yannick Duchêne (Hibou57)
2011-11-30 11:04   ` Natasha Kerensikova
replies disabled

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