Re: Drastic slow-down in the execution time of my program
Marcelo R wrote:
Thanks Carl.
Can you make your test program write out incremental progress so
that you can see where the slowdown is occurring (i.e. all at the
start, evenly spread, etc).
It's evenly spread. Remember how I said that I run the program from
inside a loop in a batch file, and that each time the program runs it
does 2000 iterations of a complex calculation? I can have 40
consecutive runs where every single iteration takes between 14 and 17
ms, and then on the next run every iteration will take between 206
and 208 ms - more than ten times slower. Then the next run is back to
normal.
OK - Yes, you did describe that clearly, I didn't read clearly enough! (I
wasn't sure if you were measruing total program invocation time or the
individual calculation time).
Next thought: Does the calculation involve memory allocation? Are there
multiple threads involved? I'm wondering if there's some kind of
pathological cache behavior going on that causes the cache hit ratio to
suffer markedly.
Misbehaving network hardware can sometimes cause all sorts of odd
pauses, as can misbehaving IDE/ATA interfaced storage devices. I
couldn't tell for sure from your original post, but I'm assuming
that you've reproduced this behavior on several of your industrial
PCs while being unable to reproduce it anywhere else, yes?
That is correct. I have seen the same thing on every one of the
industrial PCs where I tried it, and not on any of the half a dozen
desktops and laptops where I tried it.
I have written to the manufacturer of the industrial PC and I am
waiting for an answer.
One more thing that adds to the mystery: a colleague suggested that
Windows was slowing down the clock rate for some reason. So I ran two
programs simultaneously: one from a loop in a batch file and the
other in a single execution that would take hours to complete. At the
times when the first one was running very slowly, the second one was
still running normally. So it's not the whole CPU that slows down.
That is interesting - in fact, bordering on the inexplicable. I wonder
again if some kind of pathological cache-hit case could explain that - the
slow instance is getting a bad cache hit ratio while the other is doing
alright. It'd be an extraordinary circumstance, but it might fit.
What's the CPU in the industrial PC? Have you tried any other machines with
the same CPU?
-cd