Re: Is intrinsic MIN inefficient?

From: Jeff Krimmel (madscientistabc03_at_hotmail.com)
Date: 05/12/04


Date: Tue, 11 May 2004 23:50:56 -0700

On Thu, 06 May 2004 15:02:05 +0000, robin wrote:

> Jeff Krimmel <madscientistabc03@hotmail.com> writes: > Greetings,
>>
>> I have a program that takes five days to run to completion, and I used
>> gprof to profile the execution on the most recent run. One subroutine of
>> the 28 takes 28.59% of the execution time, and this subroutine is
>> basically of the form:
>>
>> DO i=start,end
>> result(i)=MIN(bunch of algebraic computations, 1d6)
>> END DO
>
> I would investigate the "bunch of algebraic computations".
> Is there an unnecessary conversion or somesuch there?

No, not that I can tell, though I am a novice at much of this. It is a
series of summations of terms like

(array(a,b) - array(a,b-1))**2

except with "b" and "b-1" being slightly different in the other terms.
Around twelve of these terms are added, and MIN is called to determine if
this sum is less than 1d6.

Jeff

-- 
Add an underscore between 'd' and 's' and remove the first three 
letters of the alphabet for email.


Relevant Pages

  • Re: [Full-disclosure] Facebook script injection vulnerabilities
    ... Escaping JS sandbox with literal String reference ... execution of unrestricted JS on canvas pages or profiles ... (mouseclick required on profile pages) ...
    (Full-Disclosure)
  • Re: profiling C code an generating call graphs
    ... I want to profile a C program I am writting, so I compile it with -pg ... convert between gprof format and graphviz .dot format. ... It's ready to go through dot. ... encrypt -> XORBuffer; ...
    (comp.lang.c)
  • Re: GCC time.h problem.
    ... my code) execution time changes and hence the printed time output.But ... suggest you try execution profilers instead. ... If what you say about CLOCKS_PER_SEC were true, it would imply on most systems a much better resolution than is available in gprof. ... gprof, how it can be used on Windows, and how is broken on Red Hat x86-64, and most other 2.6.x kernel implementations, goes well Off Topic. ...
    (comp.lang.c)
  • [Full-disclosure] Facebook script injection vulnerabilities
    ... Most of the issues require the victim user to click on a profile box ... execution of unrestricted JS on canvas pages or profiles ... The JS sandbox denies references to Function.constructor ...
    (Full-Disclosure)
  • Re: Devel::SmallProf claims "return 1" needs much time !?
    ... I often find SmallProf to be unreliable, especially when trying to profile ... code portions which are fast on each execution but are executed very often. ... doubt on the entire reliability of the SmallProf output. ... suppose disc caches work their wonders...). ...
    (comp.lang.perl.misc)