comp.lang.ada
 help / color / mirror / Atom feed
From: czgrr <czgrr@my-dejanews.com>
Subject: Re: scope and/or parameters (beginner)
Date: 1999/04/15
Date: 1999-04-15T00:00:00+00:00	[thread overview]
Message-ID: <7f46ij$vfo$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 7f23j5$4mu$1@nnrp1.dejanews.com

In article <7f23j5$4mu$1@nnrp1.dejanews.com>,
  Robert Dewar <robert_dewar@my-dejanews.com> wrote:
[Snip everything, just for space, really; read the post if you want details]

To quote Chandler from "Friends": "Can open, worms everywhere!"

You are correct, the test gives a very limited conclusion, it is flawed in
many ways, etc, etc. I did not intend that example to be suitable code, but
just to show my point - which it did, in that on *my* implementation, with
*my* setup and with the very example-specific code shown, I got a result
which was much different from yours, and which was not as expected.

However, and I say this as my last posting to this thread...

There is a large, real-time critical program which worked fine. Then it was
ported from one machine to another without any code changes and suddenly had
a serious performance problem. Moving locally declared, generic-based
packages to global scope, and also some large arrays, just like in the
example I gave, solved the problem, and that is all that was changed.

Now there are many factors, which you have touched upon in your last post,
which may have caused the problem, but this was "real" code, in a "real"
environment. I couldn't produce that exact code for you to try on your
machine because a) there would be too much of it, b) I do not own the
copyright, and anyway c) I don't work for that project any more. So I'm
afraid I/we will never know the exact or "true" reason for the difference in
performance.

But it worked. The problem was fixed by a single change without affecting
functionality. The customer and the project were happy. The code is more
portable as a result, because it depends just that little bit less on the
environment in which it is run.

And making the same change to the code on the original machine had no visible
effect on that, either, so why not code it like that to begin with? Ever
since then, when I have the same sort of situation with very large arrays,
etc, I always make them global. It is less logically correct, yes, it may not
be necessary *in that environment*, yes, but it had fixed a bug and I learned
from it.

And when someone on a discussion forum asks a related question, I give my
opinion, based on my experience, and that is all I can give. It is up to the
readers of this thread to make their own choice as to how they would code a
particular situation, and I have had my say, you have had yours, and that the
end of the story.

All the best,
czgrr

--
My opinions, suggestions, etc, are not necessarily those of my employer.
They might not even be right. Use at your own risk.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1999-04-15  0:00 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-02  0:00 scope and/or parameters (beginner) fluffy_pink
1999-04-03  0:00 ` Matthew Heaney
1999-04-05  0:00 ` Corey Ashford
1999-04-05  0:00   ` fluffy_doo
1999-04-06  0:00     ` Matthew Heaney
1999-04-08  0:00     ` czgrr
1999-04-10  0:00       ` fluffy_puff
1999-04-12  0:00       ` dennison
1999-04-13  0:00         ` Robert Dewar
1999-04-13  0:00         ` czgrr
1999-04-13  0:00           ` Robert Dewar
1999-04-14  0:00             ` czgrr
1999-04-14  0:00               ` dennison
1999-04-14  0:00               ` Robert Dewar
1999-04-15  0:00                 ` czgrr [this message]
1999-04-15  0:00                   ` Robert Dewar
1999-04-13  0:00     ` Robert A Duff
1999-04-14  0:00       ` Robert Dewar
1999-04-14  0:00         ` Hyman Rosen
1999-04-14  0:00           ` dennison
1999-04-14  0:00             ` Hyman Rosen
1999-04-14  0:00               ` dennison
1999-04-14  0:00                 ` Hyman Rosen
1999-04-15  0:00                   ` dennison
1999-04-15  0:00                     ` Robert Dewar
1999-04-15  0:00                       ` Hyman Rosen
1999-04-15  0:00                       ` dennison
1999-04-15  0:00           ` Robert Dewar
1999-04-15  0:00             ` Hyman Rosen
1999-04-15  0:00               ` Robert Dewar
1999-04-15  0:00                 ` Hyman Rosen
1999-04-16  0:00               ` Rakesh Malhotra
1999-04-15  0:00       ` fluffy_dong
1999-04-15  0:00         ` Robert Dewar
1999-04-15  0:00           ` dennison
1999-04-15  0:00             ` fluffy_dong
1999-04-16  0:00               ` Robert Dewar
1999-04-16  0:00                 ` Fraser Wilson
1999-04-16  0:00                   ` Gautier.DeMontmollin
1999-04-20  0:00                     ` Nick Roberts
1999-04-21  0:00                     ` fraser
1999-04-22  0:00               ` Robert A Duff
1999-04-22  0:00                 ` Larry Kilgallen
1999-04-16  0:00         ` Samuel Mize
replies disabled

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