Yes, input data is transferred to the R-server of SAP and the result set is returned to the browser. I don't think there is an option to improve the performance of the R-Server hosted by SAP, other then rewriting the code more efficiently (if possible) and/or reduce the data set. You can setup your own R-server to possibly enhance the performance. Please ne aware that the URL of the R-server needs to be internet facing.
I would suggest to log a support ticket and see if you can collect some feedback on how the R-script is performing on the SAP infrastructure.
Martijn van Foeken | Interdobs