Auto Insert Favorite Tokens in Keyboard Maestro

So, assuming you used the same repeat values as me, Filter is ~4 times faster for you than the Execute a Shell Script action.

That plays along with my untested theory -- the faster the processor, the fewer simple KM actions the Execute a Shell Script action need replace to become optimal. That's because KM actions execute at a maximum rate of 1,000 actions per second, regardless of processor speed, but the speed of shell instantiation and that of the processes executing within that instance isn't similarly restricted.

But we're talking milliseconds here, so not really something to worry about in practical use. Go with what works and, importantly, with what makes sense to you.