comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Most efficient way to check for null string?
Date: 1997/06/20
Date: 1997-06-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.866854741@merv> (raw)
In-Reply-To: EC3A2y.970@world.std.com


Robert Duff said

<<It's quite easy to write a compiler where #1 is as efficient as #2.  If
a given compiler doesn't do that, I take it as an indication that its
customers don't care about this sort of thing.>>


It's not quite so simple. The business of optimizing special cases is a never
ending task. Obviously all customers will say they want the code as fast
as possible, but they have two other requirements:

1) they do not want to pay infinite money
2) they do not want to wait infinite time

therefore the desire to optimize as much as possible has to be balanced
against other requirements.

What you can deduce if a compiler does not optimize the comparison with
the null string is that it has not yet been decided that this is a significant
enough optimization to be worth while, or more likely that it has never come
up, which is a bit different from your conclusion, generalized apparently
to all possible similar optimizations ("this sort of thing")





  reply	other threads:[~1997-06-20  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-20  0:00 Most efficient way to check for null string? Dale Stanbrough
1997-06-20  0:00 ` Robert A Duff
1997-06-20  0:00   ` Robert Dewar [this message]
1997-06-20  0:00 ` Tucker Taft
1997-06-21  0:00   ` Robert A Duff
1997-06-21  0:00     ` Robert Dewar
1997-06-23  0:00       ` Tucker Taft
1997-06-23  0:00       ` Richard Kenner
replies disabled

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