Kantu gets slower and slower the longer the script is running

Hello, I’ve been using Kantu for a while and I was really happy when the IPC bug has been solved, because I was finally able to run scripts without worrying that they will hang, however, recently I have discovered another huge issue.
It seems that whenever you run the script and leave it for an hour or more - it gets super slow, up to 10 times slower than it is on the initial start. I’ve created a simple performance script that clearly shows the issue:

{
  "CreationDate": "2018-10-28",
  "Commands": [
    {
      "Command": "store",
      "Target": "fast",
      "Value": "!replayspeed"
    },
    {
      "Command": "store",
      "Target": "Iteration",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "Speed in seconds",
      "Value": "!csvLine"
    },
    {
      "Command": "csvSave",
      "Target": "performance_test",
      "Value": ""
    },
    {
      "Command": "store",
      "Target": "0",
      "Value": "i"
    },
    {
      "Command": "store",
      "Target": "10000",
      "Value": "j"
    },
    {
      "Command": "label",
      "Target": "START",
      "Value": ""
    },
    {
      "Command": "storeEval",
      "Target": "Date.now()",
      "Value": "start"
    },
    {
      "Command": "storeEval",
      "Target": "${i}+1",
      "Value": "i"
    },
    {
      "Command": "storeEval",
      "Target": "(Date.now()-${start})/1000",
      "Value": "end"
    },
    {
      "Command": "store",
      "Target": "${i}",
      "Value": "!csvLine"
    },
    {
      "Command": "store",
      "Target": "${end}",
      "Value": "!csvLine"
    },
    {
      "Command": "csvSave",
      "Target": "performance_test",
      "Value": ""
    },
    {
      "Command": "echo",
      "Target": "Run time - ${end}s",
      "Value": "red"
    },
    {
      "Command": "gotoIf",
      "Target": "${i} < ${j}",
      "Value": "START"
    }
  ]
}

Just leave it until it times out (15min), then open the “performance_test.csv” file and check the initial speed values and then compare with the values in the end of the script.

In my case, the average speed for the first 100 iterations was 0.324s, while the average speed for the last 100 iterations was 0.551s, which is 70% slower than it was in the beginning JUST AFTER 15 MINUTES OF RUNTIME . So you can only imagine what happens when you leave the script for an hour or longer.

I really hope that this data will help you to fix this issue as soon as possible and also thank you so much for your great work on creating one of the best automation tools currently available. :+1:

Thanks, I confirmed the issue and we will be working on this.

As workaround, can you use the command line to start the macro, and then close Chrome again after e. g. 100 loops, and restart it? The command line has the close paramter. That should avoid the slowness issue.

If you can not use the command line for any reason, I would be interested to learn why :wink:

Thanks for the cmd macros suggestion, I will probably need to spend the whole day rewriting my scripts, but I may give it a try as a temporary solution. :smiley:

6 posts were split to a new topic: Command line close=1: Do not close browser when user (manually) stops macro

Just to add to my last post: Here is a sample Powershell script that shows how to

Of course, the same can be done in C#, Node.JS, Python, Ruby, VBS or any other scripting or programming language.

1 Like

Thanks, @admin ! The problem is that every time the chrome tabs are being reopened, they must have the different URL which I find difficult to implement as I cannot change the macro file. The only solution I found is to each time write that variable into csv file and then read it from there. But all this process still slows down the whole procedure, so I really hope that you will soon be able to find and fix the bug that causes the scripts to slow down. I have applied to a beta testing, so if you need some help with this bug - then just let me know and I’ll do my best to make sure that you fix it as soon as possible.:heart:

@admin this issue wasn’t fixed in 3.5.0? :frowning:

No changes in 3.5.0. But we plan to work on the stop issue soon, and ideally that fixes “your” delay issue as well.

But there is some good news, too:

they must have the different URL which I find difficult to implement as I cannot change the macro file. The only solution I found is to each time write that variable into csv file and then read it from there.

This can be done now directly via the command line with the new ${!cmd_var1}/2/3 internal variables! In other words, you can send the URL directly from your calling script and it will be available in ${!cmd_var1}.

Hey @admin, I am renewing this post as the issue is still existent 3 updates later.

Kantu not only gets slower over time, but it also periodically gets stuck for a moderate amount of time for an unknown reason, therefore, unfortunately, but the extension is not optimised for an extended time of usage such as leaving it running for 30 minutes or longer.

You have mentioned a workaround with cmd that would check if the script freezes and then restart the browser, however in a real life scenario it is much more difficult to implement, especially if you are working with multiple tabs and if the working session gets closed (user being logged out) after reopening the tabs.

Therefore I really hope, that you will finally address this issue, because it would greatly increase the usage possibilities of the Kantu extension and it would also become a much more attractive automation option for various companies, especially for those, that are working with Big Data. :+1:

Hello @admin, I have the same problem. Kantu is slow gets slow after 100 loops.
Here is a video : - YouTube.
I’m 100% agree with @TFD777. Fixing this problem will increase the usage possibilities for Kantu extension.
What’s your latest recommendation ? Thanks for your help.

Hi… it says the video is unavailable?

The stop issue mentioned in this post is fixed meanwhile.

As for the delay issue, a test macro and some numbers would be nice. How much slower does it get?

Best if you open a new forum post as this one here is quite old and contains several meanwhile fixed issues.

The link to the PS script doesn’t work: Page not found

The new link is RPA/command-line at master · A9T9/RPA · GitHub

1 Like