URL Trigger VS keyboardmaestro CLI Tool: is there any performance difference?

Is there any performance advantage triggering using the "keyboardmaestro CLI Tool" over the "URL Trigger"?

Secondary question: is there any drawback when using the "keyboardmaestro CLI Tool"? (It seems to me that the CLI has advantages in every aspect, right?)

Thanks!

Interesting question. I am willing to measure the speed of both, but it's not clear to me which app you are planning to use the URL trigger from. Are you planning to use it from a web browser, or maybe from the curl tool? This would make a big difference when measuring the performance.

I'm not sure how to measure sub 1 second values in keyboard maestro execution time, but both methods take less than 1 second between executing the "calling" macro, using CURL or calling the CLI directly and the "receiving" macro executing. Obviously, if you can, i'd always prefer to use the CLI, since you aren't sending a request out to the internet.

I'm triggering KM macros from MacVim (using Vimscrip).

Vimscript has a builtin funcion "system()" that "Get the output of the shell command as a String."

Not many calls per minute, but I would like it to be as fluid as possible.

Since I don't use that product, I won't be able to measure its speed. I was expecting you to use a shell script. I'm not sure if my test would be valid for your requirements.

I don't think he was intending to do that. When you use the "kmtrigger URL syntax", I think it goes directly to your localhost's KM web server. I think you were inferring that he wanted to use KM's public web server which is not the same thing.

I usually create a loop, run 1000 tests, then divide the result by 1000. This may be helpful. The true value will be lower than the result of this test, but it may provide a useful comparison between two or more differing methods.

Hi, @Airy!

Could you run your test?

If you share your script, I'll try to replicate it in Vimscript.

Define "performance" :wink:

My guess is that it'll depend on which method is more efficient for MacVim which is why, as @Airy says, you really need to test for yourself. But given that the triggering and running of all but the most trivial of macros is going to "cost" more sending the trigger command to the Engine in the first place, by either method, is it really something to worry about?

IMO, go with what's most usable for your situation.

After all, if performance was that important you wouldn't be wasting CPU cycles on a GUI version of something that could be run in Terminal, as God intended :wink:

1 Like