You might see that it renders fast now. What I changed is that I put the script in a custom block, I checked in the box "Without screen refresh, to do that you create a custom block, press "options" and check in "Without screen refresh".
All the credit goes to @JJ077.