Why is RPA slower than Python

Hello, this time the slow was me, but i was busy.

The slowness of RPA is in its core.

I will put a simple example, a program counting from 0 to 500 and printing the number on screen, i will do it in pyhton and RPA, i can understand RPA can become slow when interacting with a web thats why my example doesnt use a web

python code:

for x in range(0,500):
print(x)

RPA code:

{
  "Name": "counting",
  "CreationDate": "2020-2-22",
  "Commands": [
    {
      "Command": "store",
      "Target": "0",
      "Value": "x"
    },
    {
      "Command": "while_v2",
      "Target": "${x} < 500",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${x}",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${x}) + 1",
      "Value": "x"
    },
    {
      "Command": "endWhile",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${!RUNTIME}",
      "Value": ""
    }
  ]
}

python run time:
about 1 sec

RPA run time:
between 90-100 secs

And thats is on the first run!!! do you all know rpa gets slower and slower the more the time the macro is running, i have the theory if you leave a rpa macro running enough time you can bend space-time

Well, of course Python is much faster then RPA. But C++ is much faster than Python, and that does not make Python a bad choice :wink: Each tool is optimized for different things.

UI Vision RPA is a tool for UI automation and Web automation, but not for fast calculations. Whenever you interact with a UI, the speed of RPA is fine.

If you need fast calculations done inside the RPA macro, the solution is the XRun command to call outside scripts like Python, Powershell or even C++.

If you have a (Web) GUI automation task that runs too slow, please let me know! A screencast or test macro of such a problem will be great, and we will fix it asap.

Important: If you run a macro loop in fast mode without any web or desktop commands inside (no click, xclick, type,…) like your 0…500 loop test macro then UI.Vision looks “frozen” to the web browser after a while, since there is no interaction during the loop. Chrome will display a “Page Unresponsive” warning:

page%20unresponsive

The solution is to add a Pause | 1 command inside the loop:

{
  "Command": "pause",
  "Target": "1",
  "Value": ""
},

This macro needs ~40s on my laptop for the 0…500 loop:

{
  "Name": "500",
  "CreationDate": "2020-2-23",
  "Commands": [
    {
      "Command": "store",
      "Target": "fast",
      "Value": "!replayspeed"
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "x"
    },
    {
      "Command": "while_v2",
      "Target": "${x} < 500",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "1",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${x}",
      "Value": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return Number (${x}) + 1",
      "Value": "x"
    },
    {
      "Command": "end",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "${!RUNTIME}",
      "Value": ""
    }
  ]
}