in reply to Re: Dprofpp, random subroutines
in thread Dprofpp, random subroutines

What optimisation? This is *profiling* a script, which is one of the methods used to test if a script needs optimisation. Obviously in it's current form it doesn't really, but I would still like to be sure of exactly what is going on.

Replies are listed 'Best First'.
Re: Re: Re: Dprofpp, random subroutines
by BrowserUk (Patriarch) on Oct 07, 2003 at 18:55 UTC

    Sorry for my sense of humour. I would say that you do know exactly what is going on. The explaination and reasoning that you gave in your original post was probably spot on.

    The differences between the routines is so small that the timings are simply not able to accurately arbitrate between them. Which order they come up in is probably more influenced by whether you moved your mouse, or received an incoming ip packet, or adjusted the volume on your pc, or even cosmic rays rather than any detectable differences in the time they took.

    If your on 5.8.1, then it would even be possible that the difference was due to a combination of the randomisation that is being applied to the hashing algorithm and the fairly recent 'stable' sorting methods.

    If, (as I assume) the data is maintained internally in a hash, and then sorted for presentation, then the stable sort will tend to leave "equal" elements in their original order, but the original order that keys are returned from a hash will vary from one run to another, hence the randomness you are seeing. Or one possible explanation for it.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail

      I don't mind humour, but your first post sounded a little too condescending for me to think of it as humourous. Anyways, thanks for affirming my original thoughts.