comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: short-circuit control forms
Date: Fri, 22 Jun 2001 21:49:41 GMT
Date: 2001-06-22T21:49:41+00:00	[thread overview]
Message-ID: <V3PY6.5653$yp1.209167@www.newsranger.com> (raw)
In-Reply-To: 5ee5b646.0106221258.601d2bce@posting.google.com

In article <5ee5b646.0106221258.601d2bce@posting.google.com>, Robert Dewar
says...
>It is quite obvious that in some cases short circuiting is critical
>for efficiency without needing detailed measurements. For example, 
>when searching in a binary tree, it can make the difference between
>O(logN) and O(N) behavior in extreme cases (well in recursion cases

But if the binary tree isn't ever that large, then it might not be "critical for
efficiency" at all. However, in this case I'd agree with you completely that you
should probably still go with the short-circuit in the first place. 

Then again, this is a bit of a strawman argument. What are you doing using a
binary-tree instead of a simple linear linked-list in the first place, if the
performance hasn't already been determined to be "critical for efficiency"? It
seems in this case you have already started looking at efficiency, so its fairly
easy to agree with you that this is a case where its sensible to keep such
details in mind.

I have to wonder how much of the sides people take on this issue has to do with
the kind of applications they generally develop. The short-circuitist approach
does have the benifit of minimizing *average* runtime for an application. That
is a damn important number for anyone writing CPU-limited input processing
application like a compiler. However, for us folks doing real-time work, we
don't care at all about that number. What we have to worry about is meeting a
deadline in the *worst* case (or the deadline - our targeted spare). If we do
meet that deadline, great. If we don't, its usually due to one or two horribly
inneficient constructs somewhere in a tight loop, and the odds of it being a
non-short-circuit is pretty slim (could happen, but I haven't see it yet). The
other problem we have to deal with occasionaly is jitter (a routine taking a
variying time to complete, causing noticeble time variations somewhere else).
That issue is actualy made a smidge *worse* using a short-circuited construct.

Anyway, it seems that, of the positions I can identify, the most vocal
short-circuitists are compiler writers, and the most vocal nonshort-circuiters
are real-time programmers. But perhaps my analysis is a bit off, and the truth
of the matter is that you compiler writers just happen to be much more
knowledgable than us real-time developers. After all, at you are at least smart
enough to work on a system that can be used and debugged on your host machine.
We have to walk over to labs or fly halfway around the world just to try out our
code properly. How stupid is that? :-)

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  reply	other threads:[~2001-06-22 21:49 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-20 19:23 short-circuit control forms James A. Krzyzanowski
2001-06-20 20:15 ` Ted Dennison
2001-06-20 20:47 ` Marin David Condic
2001-06-20 22:23 ` Jeffrey Carter
2001-06-21  0:45   ` Al Christians
2001-06-21 15:06     ` Wes Groleau
2001-06-21 15:46       ` Al Christians
2001-06-21 18:28         ` Wes Groleau
2001-06-21 18:51         ` Marin David Condic
2001-06-22 12:17           ` Marc A. Criley
2001-06-22 14:55             ` Marin David Condic
2001-06-22 20:58   ` Robert Dewar
2001-06-22 21:49     ` Ted Dennison [this message]
2001-06-22 22:58     ` Jeffrey Carter
2001-06-23  0:38       ` Larry Kilgallen
2001-06-23 17:34       ` Simon Wright
2001-06-26 15:48       ` Wes Groleau
2001-06-25 17:00     ` Wes Groleau
2001-06-21  0:13 ` Mark Lundquist
2001-06-21  0:55   ` Al Christians
2001-06-21 12:39   ` Larry Kilgallen
2001-06-21 15:02   ` Wes Groleau
2001-06-21 14:24 ` short-circuit control forms (& 'long names are doom') Paul Graham
2001-06-21 17:20   ` Warren W. Gay VE3WWG
2001-06-21 18:32     ` Wes Groleau
2001-06-21 23:18   ` Charles Hixson
2001-06-22  1:01     ` Larry Kilgallen
2001-06-22  3:10     ` DuckE
2001-06-22 15:46       ` Wes Groleau
2001-06-22 19:02         ` Ted Dennison
2001-06-22 19:16         ` Ted Dennison
2001-06-22 20:53         ` Robert Dewar
2001-06-22 20:43       ` Robert Dewar
2001-06-22 22:34         ` Jerry Petrey
2001-06-25 14:30         ` Marin David Condic
  -- strict thread matches above, loose matches on Subject: below --
2001-06-20 19:50 short-circuit control forms Beard, Frank
2001-06-20 20:35 ` Ted Dennison
2001-06-20 22:32   ` Jeffrey Carter
2001-06-21  1:18     ` Mark Lundquist
2001-06-21 17:05       ` Jeffrey Carter
2001-06-21 14:31     ` Wes Groleau
2001-06-20 23:45   ` Dale Stanbrough
2001-06-20 20:57 ` Marin David Condic
2001-06-21  7:31 ` Keith Thompson
     [not found] <B6A1A9B09E52D31183ED00A0C9E0888C469BC4@nctswashxchg.nctswash.navy.mil>
2001-06-20 21:10 ` Wilhelm Spickermann
2001-06-20 22:20 Beard, Frank
2001-06-21 14:58 ` Marin David Condic
2001-06-21 17:11 ` Warren W. Gay VE3WWG
2001-06-21 17:49   ` Marin David Condic
replies disabled

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