Re: perfomance question about bool variables in cxx

From: Klaus-D. Bohn (info_at_it-bcsb.de)
Date: 07/24/05


Date: Sun, 24 Jul 2005 14:51:25 +0200


"Bob Gezelter" <gezelter@rlgsc.com> schrieb im Newsbeitrag
news:1122058234.888333.17740@f14g2000cwb.googlegroups.com...
> Larry,
>
> With all due respect, I disagree with your explanation. If Klaus were
> dealing with a large array of booleans, I would agree with you to the
> extent that stepping through 8 times as much data (quadwords instead of
> bytes) would generate inefficiencies.
>
> In this case, the posted code generates a large number (42,949,672 to
> be precise) of references to a single variable (quadword or byte,
> respectively). In the case of the Alpha, Itanium, and almost all VAX
> models, presuming that the data is naturally aligned by the compiler,
> each reference should be a single cache or memory reference.
>
> However, this simple experiment also illustrates the difficulties and
> challenges of benchmarking.
>
> - The compiler will, in many cases, optimize out the invariant
> assignment code in the loop. Thus, with the correct compiler switches
> used, the nearly 43 million iterations of the loop will be optimized to
> a single instruction, executed exactly once.
>
> - The fine level timing of this code, if it executes even a significant
> number of iterations will be influenced by the other activity on the
> CPU. Any event which affects cache hit rate, will effect the overall
> performance of the code. To do this experiment effectively requires a
> deeper analysis, and many test runs to get a significant certainty that
> the numbers are not being influenced by random events. Science is
> reproduceable, happenstance is not.
>
> - There is a certain amount of processing that is not attributable to
> the actual code under test. This includes image activation, the jacket
> code in the test program, and image rundown. How much this is needs to
> be computed, and subtracted from the test results to obtain an accurate
> result. This overhead is the computational equivalent of the "tare
> weight", the weight of an empty container when placed on a scale.
>
> My apologies for running on a bit. I hope that this commentary is
> helpful.
>
> - Bob Gezelter, http://www.rlgsc.com
>

Hello Bob,

thank you very much.
I have a very interesting new application for the OpenVMS platform. It will
be available in october this year.
The application is ready, but I'm looking how i could increase the
perfomance. So i make some short test programs to look what is the really
difference between the variable definitions.
Normaly i could set the counter to 1. But the system is to fast to analyze
the time difference.
I get some very interesting results. Now i chance my application to a clean
64bit application.
Next step is to analyze the application with some performance tools. I hope
i have a positive result.

Klaus



Relevant Pages

  • Re: Girl Genius - 9/16/2009
    ... allegiance to Klaus. ... With the winged castle being a punning ... reference to his being based on the airship Castle Wulfenbach. ... I would make the uninteresting and mundane argument that when the artist or jeweler feels like it, he adds wings. ...
    (rec.arts.sf.written)
  • Re: Girl Genius - 9/16/2009
    ... allegiance to Klaus. ... With the winged castle being a punning ... reference to his being based on the airship Castle Wulfenbach. ...
    (rec.arts.sf.written)
  • Re: arraylist performance
    ... Du hast vollkommen recht - natürlich macht das der Compiler und nicht das ... Framework, und damit gibt's auch keinen Geschwindigkeitsunterschied (So ist ... "Joachim Fuchs" schrieb im Newsbeitrag ... > Hallo Klaus, ...
    (microsoft.public.de.german.entwickler.dotnet.vb)
  • Gnadenlos OT - war Re: =?ISO-8859-1?Q?Merkw=FCrdiges_Verhalten?= =?ISO-8859-1?Q?
    ... Parser schreibt man nicht selber, ... Büchlein "Compilerbau" eine kleine Offenbarung. ... Programmierer sollte seinen Compiler wohl kennen, und sich auf ihn verlassen, wenn angebracht. ... Klaus Rotter * klaus at rotters dot de * www.rotters.de ...
    (de.sci.electronics)
  • Re: HowTo find out the number of references to a reference type?
    ... > Finalizers in managed code are not nearly as straightforward as they ... >>Klaus Drechsel ...
    (microsoft.public.dotnet.languages.csharp)