in reply to nytprof Profiler gives diverse results

I shutdown all other programs on my laptop before running this and I got much more stable results...
The time still varied, from 7 to 10 seconds to run the critical portion of my code, but thats much more reasonable
Best I can guess is the other processes were stealing lots of cycle times from my process

Just having gmail open seems to add 3-5 seconds to my total profile time...

  • Comment on Re: nytprof Profiler gives diverse results

Replies are listed 'Best First'.
Re^2: nytprof Profiler gives diverse results
by stevieb (Canon) on Apr 04, 2020 at 19:40 UTC

    Is your software available as a distribution that can be reasonably easily installed?

    I don't write Perl code on Windows, but I do write a single piece of Windows software for Perl, and since I'm a test-first-mentality type, I have several minimalistic Windows VMs for testing on, and I'll gladly give your code a spin against these extremely stable systems if you want to see the variances against machines that are designed and designated for doing these kinds of things.

    Let me know.

      Thanks for the offer! I could provide you a zip file with all the necessary code to run the test but I don't think its needed.
      I distribute this code as an executable (which extracts perl locally and then runs it)

      Unfortunately the code will be run on general purpose laptops/desktops,
      where I have no control over what is stealing cycles from my process
      One of the worst cases I encounter is when I am demoing this code to a prospective customer on a web-Ex
      And that really seems to slow the whole process down tremendously

      I also distribute this on linux and have been playing with the profiling there to get a more stable result
      That VM does give better results varying by 1 or 2 seconds.
      Although the very useful nytprofhtml is not working for me on that VM :)

      I guess one thing I was hoping someone might tell me that there is a way to
      run the perl code as a higher priority windows task

Re^2: nytprof Profiler gives diverse results
by Anonymous Monk on Apr 04, 2020 at 21:02 UTC
    You gotta spin up the laptops, I do  perl -le" $fo++ while 1" before doing long benchmarks, and wait until the fans start hissing, otherwise first runner is always slower ...

      Interesting... Then you ctrl-c the perl -le and run the actual code?

Re^2: nytprof Profiler gives diverse results
by boleary (Scribe) on Apr 07, 2020 at 10:59 UTC

    I found this interesting nugget to enable win10 ultimate-performance-mode on my laptop...

    https://www.windowslatest.com/2018/04/20/enable-ultimate-performance-mode-in-windows-10

    it makes my laptop fan stay on...
    It did not help the code execution time while I had a browser open
    I will try with the browser closed.

    Not too much of a difference with browser closed
    What really helped to stabilize my results was Turning OFF WIFI

    Even then...
    There is still too much variance to determine if a new looping structure using a large pre-processed list
    is better than 2 loops that created the same list on the fly (using foreach and keys)

    I will look more into Benchmark as suggested by bliako