What Mac Hardware Has the Most Effect on Performance of KM Macros?

I have two macs running identical macros. They are both great machines, 2015 Mabooks - One has a 3.1 GHz Dual-Core Intel Core i7 processor and it is VERY Fast compared to the 2.5 GHZ intel core i7 - I don't know much about hardware. Is there a significant difference between these two processors that would cause one to run a macro about 5x faster than the other? If not, any tips to reset a pc to optimize performance? My macros are as efficient as I can make them and explaining them well.. would be a days process as Ive tried before. So I don't really want to get into the macro itsself. Thank you!

I hope you don't mind that I have revised your topic title to better reflect the question you have asked.

Tech / KM question

What Mac Hardware Has the Most Effect on Performance of KM Macros?

This will greatly help you attract more experienced users to help solve your problem, and will help future readers find your question, and the solution.

1 Like

Yeah better for sure! The KM Encyclopedia @JMichaelTX doesnt know the answer? I'm kidding with you but if you have some input please let me know! Thanks

I'll take a shot at this...

It may not be the processor that's the important thing: if your macro is doing a lot of disk reading/writing then it'll be the disk; if you're doing a lot of screen/image detection it could be the graphics processor; if you're doing network/Internet stuff it might be your network/wifi interface; heck - it could be your Internet provider!

If, on the other hand, you macro is doing nothing but calculations/text manipulation then it might be the processor.

And that's the definitive answer :rofl:

Oh - I forgot to mention RAM.

Oh - multiprocessors - see

1 Like

Good Info. Thank you. Im taking an API call and setting a bunch of variables such as ids of tags etc to the right value. its just for each about 30-100 times in the beginning of the macros that are acting much slower on the lower processor.

So it’s accessing an external web based api? Do both devices have similar network setups?

As noted, there is no one answer here.

It is highly dependent on the specific actions.

Any Mac can run a macro with trivial actions at essentially full speed (which is 1000 actions per second).

Some macros are highly dependent on the processor and its cores, especially OCR and Find Image actions.

Many actions are highly dependent on the performance of other systems (web actions depend on the network and browser performance for example).

Many actions depend on the AppleScript or Interprocess Communication speeds, which might depend on any number of factors.

Actions might depend on the disk performance. An SSD will likely have much better performance than a spinning disk (or even a fusion drive) as any touch on the disk tends to be extremely slow in comparison, and modern OS expects an SSD and is much less resilient to those pauses.

If you are pushing the memory limits on your Mac, then virtual memory may kick in which will be an issue across many actions (and again far worse if you have a spinning disk).

I doubt there is any software tweaks that you could do to speed up your Mac. You might be able to retrofit memory or an SSD to your Mac to improve its performance.

The best chance is you might be able to change your actions in your macro to perform the task in a more efficient manner.

But the first step is always profiling - find out exactly which action(s) is causing the bulk of the performance issue. Use the SECONDS function and record it at the start of your macro, and log the difference at many places through your macro and determine where it is spending its time. Compare the two Macs and see how they tract, see if one is always a proportion of the other, or if there are specific actions that are unexpectedly slower.

And in any event, that will give you information on which action you need to look at improving on the slow Mac.

@Byrein, I have written a few KM Actions that I use just for this purpose.
Perhaps you can adapt for your use.

Macro/Action Timer

Download Set of Actions

Macro/Action Timer.kmactions (2.2 KB)
NOTE: When you import this file into your KM Editor, it will, without any notice, insert the Actions in the current Macro, below the current Action that is selected.

I store this Action set in my KMFAM, which you can get here:
MACRO: [KMFAM] Favorite Actions and Macros

As others have said, profiling is really the only way to find out where the bottleneck is. Here's some help on zeroing in on the problems:

  1. First, use something like what @JMichaelTX mentioned above to determine elapsed time. Or you can use my logging macros: MACROs: "Write To Log File", etc., **Updated 2016-12-28. These macros show elapsed time, and since they write to a disk file instead of displaying on the screen, they're fairly transparent.

  2. Start by comparing the elapsed time of large sections of you macro(s) first. Then gradually move the start time and end time closer to each other, until you find the problem area.

  3. You honestly don't have to know a lot about the macro to do this. Just start somewhere and then start narrowing it down until you find the problems.

If any of this is confusing, think of it like this: Two people go grocery shopping. One takes twice as long as the other. Why?

Compare how long it took each person to drive to the store. If that's about the same, compare how long they spend wandering the aisles. How long does it take them to check out? How long to load up the car with the groceries? Time to drive home?

Hope this helps.

1 Like

Thank you to everyone who offered input!

I am still sorting the details out so I can have a better idea of how much faster one is running etc.