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

Remote creation of numpy arrays is slow on large lists #2

Closed
pilcru opened this issue Feb 14, 2018 · 1 comment
Closed

Remote creation of numpy arrays is slow on large lists #2

pilcru opened this issue Feb 14, 2018 · 1 comment

Comments

@pilcru
Copy link
Owner

pilcru commented Feb 14, 2018

(From email)

The code below takes 5-10 seconds to run, which is 5-10 seconds too many:

import scriptcontext as sc
np = sc.sticky['numpy']

np.array(range(10000))
@pilcru
Copy link
Owner Author

pilcru commented Feb 14, 2018

The solution is to load the list first to the remote, then create the array from the remote list, to avoid numpy reading the items of the list one by one through the connection:

import scriptcontext as sc
np = sc.sticky['numpy']

r_range = rpyc.utils.classic.deliver(rpy, range(10000))
np.array(r_range)

This supposes:

@pilcru pilcru closed this as completed in 3df481e Feb 19, 2018
pilcru added a commit that referenced this issue Feb 19, 2018
pilcru added a commit that referenced this issue Feb 19, 2018
pilcru added a commit that referenced this issue Feb 19, 2018
pilcru added a commit that referenced this issue Feb 20, 2018
@pilcru pilcru pinned this issue Feb 1, 2021
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

1 participant