Xrunandwait excruciatingly SLOW

Please tell me how to make xrunandwait run better, because its freezes the macro.
i have a call to an script python of 120 lines, small, when i run it from command line it executes instantly less than 1 sec, so the problem is not the script, but when i call in from RPA macro, it freezes about 10 secs.

The problem is i’m making a bot for a browsergame and actions must be done inside a timeframe (example you have 10 secs for attack) so if xrunandwait freezes 10 secs i lose the time frame and the bot FAILS, i tried EVERYTHING to speed up, at first the data was retrieved from a network share on a gigabit network, and i though, maybe the network is lagging, so i moved the data to local disk, maybe the disk is not fast enough to run a 120 lines of code script, so i moved all to a SSD, i have ryzen 7 3700x and 64 f**ing gb of ram, but the problem is RPA keeps drooling looking at infinite instead of running the script, i though maybe xrunandwait is waiting for some exit code and the script is not giving it, i tried xrun, and added a pause of 2 secs after, my script runs in miliseconds, and 2 secs is a good delay, at least i have 8 secs more, but its the same, xrun keeps drooling looking at infinite too.

Please optimize your code when calling external scripts, or tell me whats is the trick, maybe is the call, where is located? absolute or relative path? give me a hint
Thank you

The call to XRUNandWait should be instant, certainly much less than one second!

To test:

  • If you call a simple Python script, does it also take so long?
  • If not: Can you please post your script?
  • And is this Mac, Windows or Linux?

How long has the browser been running? Have you tried a restart?


I found the error.

AS my computer is quite powerfull, 8 cores 16 threads and 64 gb ram, nvme, ssd, etc. I usually run several programs in background because the computer can handle it, so i have photoshop and a couple virtual machines and/or emulators and compilers, so in task manager my cpu is always about 30% use.

RPA is cpu and memory hungry, so just starting it raises my cpu use to 50-60% but the best is when reach the line with xrunandwait, it rockets the cpu use to 100%, so when the python script tries to run, no cpu left and cannot run, as xrunandwait is still waiting for the script to finish and the script cannot finish because it cant start yet because no cpu for it and because xrunandwait is still waiting it doesnt release the cpu so endless loop, until some other process release a little cpu the script can use to run, then end and send the signal to xrunandwait and release cpu and the script continues.

I tried to close first all background programs and let the computer exclusive only to run the script and then it works fast because when xrunandwait absorbs all the cpu it reach to 80% only “only” lol, so still cpu power to the script to run, so it can run.

anyway the problem is still there because its not natural to have a dedicated computer to run a script and the rpa addon consumes a lot cpu/ram but xrunandwait is cpu hungry.

Interesting finding. We will test this further and improve it with updates. I h ope we can recreate it easily.