Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R-script call slow ? #18

Open
xerviami opened this issue Feb 22, 2018 · 1 comment
Open

R-script call slow ? #18

xerviami opened this issue Feb 22, 2018 · 1 comment

Comments

@xerviami
Copy link

Hi,

I call r-script a lot of times (hundreds). in my node script.
Each call of r-script takes 1s whereas nothing is performed in the R script (just gives back a number without any computation).

In my node script, I put a "console.log(new Date());" before AND after calling r-script -> this is how I evaluated duration of r-script call.

Do you know how to make things faster ?

Thank you in advance
Kind regards
XAvier

@DrMMu
Copy link
Contributor

DrMMu commented Feb 25, 2018

I have also noted that calling R from Node.js involves quite some overhead.
I don't know how to speed up the R call.

Since you are calling R hundreds of times, it would be beneficial if R would not be terminated between the separate calls. However, I have no idea how to realize this quickly in the given Node.js environment. You would need some kind of R demon or R server running all the time, and then you would pass your scripts to it. This would at least save you the constant starting / terminating of RScript.

What you maybe can do: I understand that you loop through "something", resulting in hundreds of calls to R. Can you move that loop to R directly?

Br, M.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants