Re: forall and do loop



On Jul 27, 10:29 am, aeroguy <sukhbinder.si...@xxxxxxxxx> wrote:
Ok thanks... I like the easier-to-read concept!! okay then i will
proceed with that and complete the coding and also begin looking for
a good freeware profiler tool to look into the bottlenecks. Any
suggestions in this regard.


For gfortran there's -pg option for profiling run and gprof for
parsing the output and building statistics.
Note that the Heisenberg uncertainty principle holds for profiling -
profiling itself affects the optimized program (and disables some
optimizations), so it's never a perfect measurement, but it's
certainly useful to get an idea where most of the time is being spent.
Commercial compilers (Intel, EkoPath) even offer the possibility to
use the profiling information for subsequent optimizations, which is
potentially very powerful approach.

So from the discussion i conclude that coding style is not relevant in
some extent for code optimization and i can use the easier-to-read
concept and let the complier take care of the rest and if there are
some bottlenecks then i can use highegg's suggestions.

Not so long ago, I thought the same way as you - that I should develop
a Fortran coding style that will make my programs automatically well-
optimized. By this newsgroup and subsequent own experiences I was
taught differently. My code looks simpler and
more elegant now, and even the coding is more fun :)

On one project (propeller aerodynamics), I have also wasted my time
for an experiment - I developed two versions of the code, one using
assumed shape arrays and array results and expressions and all that
performance-dangerous stuff, other using assumed size arrays with
storage associations and explicit loops and such stuff. In the end,
the running times were differing by 1.5% at most, and the "optimized"
code looked fairly more clunky (particularly using assumed size +
storage association instead of assumed shape+sections) and took more
time. On the other optimizing the real bootleneck (a numerical
integral evaluation) reduced runtime by 50% afterwards.
After that, I was convinced of the "Knuth's law".

.



Relevant Pages

  • Re: recommended way implementing a debugger
    ... Passive profiling ... Active profiling tends to work best for things like ensuring code ... Passive profiling tends to work better for measuring the exact time ... because turning on any sorts of optimizations ...
    (comp.lang.asm.x86)
  • Re: Optimizations to Reduce Memory Consumption and Minimize Paging
    ... Without a compiling sample, ... tried profiling the two side by side (even simply Performance Monitor ... The most obvious "optimizations" appear to be the calls to GC.Collect, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: JavaScript implementation
    ... to write about saving 1 microsecond? ... As with all optimizations: Don't do it, ... profiling) that it is going to help. ...
    (comp.lang.javascript)
  • Re: ruby-ole-1.2.3 released!
    ... Initial property set support. ... Optimizations from benchmarks and profiling, ...
    (comp.lang.ruby)
  • Re: Compiler optimisation
    ... > Hopefully he's coding a few more (optimizations) into the compiler ... That would be sweet. ...
    (borland.public.delphi.non-technical)