CPU Usage

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
New2Macro13
Newbie
Posts: 3
Joined: Tue Apr 24, 2012 2:49 am

CPU Usage

Post by New2Macro13 » Tue Apr 24, 2012 2:56 am

Hello,

I have a fairly new Core i7 processor (2720-QM), quad core which runs at 2.2ghz with turboboost to 3.2ghz. I run MS13 in vmware workstation on a fresh xp build with only the few necessary additional applications that I require MS13 scripts to operate with.

I have several of these virtual machines running at once, and for each one, while the script is in use, it consistently takes about 13% of my cpu power just to run the script, per virtual machine. Is this high, and if so, is there anything I can do (regarding system settings or something) to reduce it?

Thanks for any advice!

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

Post by Marcus Tettmar » Tue Apr 24, 2012 9:18 am

What are the scripts doing? Do any have loops? If you have loops have you inserted a small wait inside them?

http://www.mjtnet.com/blog/2006/04/28/tight-loops/
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

New2Macro13
Newbie
Posts: 3
Joined: Tue Apr 24, 2012 2:49 am

Post by New2Macro13 » Tue Apr 24, 2012 1:18 pm

I pretty much have one loop with a few subroutines and the only intensive process is image recognition in order to determine further actions. I do have several wait times set up, but that is in order to avoid mouse clicks or other actions from occurring too quickly and interfering with each other. I will take another look at the code and add some of those small wait times after every action and see if that helps.

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

Post by Marcus Tettmar » Tue Apr 24, 2012 1:34 pm

Image Recognition can be quite intensive especially if you are scanning the entire screen (which is default behaviour). Using FindImagePos you can reduce the haystack down to a rectangle or window which will reduce the load.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

New2Macro13
Newbie
Posts: 3
Joined: Tue Apr 24, 2012 2:49 am

Post by New2Macro13 » Tue Apr 24, 2012 1:45 pm

Well by just adding a bunch of 0.05 wait times in like 10 places I cut it down between 0-5% depending on where the script is for each machine and I'm happy with that. Thanks for your help!

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