Hick ups that deteriorate script performance

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
remco.remco
Newbie
Posts: 12
Joined: Wed Jul 06, 2016 12:19 pm

Hick ups that deteriorate script performance

Post by remco.remco » Sun Oct 02, 2016 9:36 pm

Hi,

I'm working on a script that requires high speed. I have one script running in a virtual machine, another one in Windows 10. They go both with around 20 loops per second and in those loops, quite some activity in being handled. Communication between the two environments goes via the shared folder.

I have log files, like below. The numbers are milliseconds. So I keep track of how log each subroutine takes.
In general I can get the speed that I need. But sometimes, some instructions take hundreds of milliseconds instead of a few milliseconds. For instance writing of the log file. But also other stuff that in all other cases needs only milliseconds, suddenly takes longer, and almost always about 300ms extra. So 5ms normal, 300ms with hick up.

It looks like windows decides that no time slot is available for my script every now and then. The CPU activity is 60...70% when all my stuff is running. When an instruction takes longer than expected, it is usual around 300ms extra.

I try of course to limit the demands that my script puts on the CPU. But is there another way to prevent that all of a sudden a hick up occurs of 300ms? The script really stops for 300ms then and that's a problem if you want to loop 20/second....
I rather have that 300ms spread out than at one moment. But how to achieve that....

Kind regards,
Remco

Log example with everything going okay:
73450 ReadEngineOut: String:
73450 ReadEngineOut: CandidateThinkingTime: 10
73450 ReadEngineOut: First output in: 188ms (mean: 196ms min/max: 188ms/203ms)
73450 ReadEngineOut: TimeDiffLoc: 188 TimeDiffSum: 391 TimeDiffCounter: 2 TimeDiffAverage 196
73450 ReadEngineOut: TimeDiffLocMIN: 188 TimeDiffLocMAX: 203
73481 MakeMoveForMe: Locked: 0 HelpMe: 0 RealOutput: 1 Help: 1 JustAnswered: 0
73495 GetMove: Before CheckForEmptyLine
73504 GetMove: GetTextQuick: 1
73505 Read: BeforeGetTextAtPoint
73506 Read: NewResultTemp: 2 ItemsTemp: 2 ReadAttempts: 1
73506 Read: x: 827 y: 444

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: Hick ups that deteriorate script performance

Post by Marcus Tettmar » Mon Oct 03, 2016 4:17 pm

About all I can think of is to increase the process priority in Task Manager.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts