-
Notifications
You must be signed in to change notification settings - Fork 161
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
Setting vectors is slow #1485
Comments
|
This is because the first two do an all-at-once copy, the last one does, for every entry, a getitem on G.vector(). |
I was caught by this when porting FEniCS code, and the cost wasn't obvious until it dominated the calculation. Perhaps a warning could be added? Or this could removed, as it is so slow when used like this. |
I'm open to the option of putting in a warning on |
You could also if isinstance(value, Vector):
self.dat.data[idx] = value[idx] In |
The construct
Function.vector()[:] =
is very slow. The following example:leads, in a test on my machine, to
The text was updated successfully, but these errors were encountered: