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

Coordinates for `Morphology` are calculated inefficiently #741

Closed
mstimberg opened this Issue Sep 1, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@mstimberg
Member

mstimberg commented Sep 1, 2016

Morphology sections only store relative coordinates internally, when you access their coordinates it has therefore to access the coordinates of the parents section (which in turn has to access its parent section, and so on) to calculate the absolute coordinates. This approach has many advantages over storing and updating absolute coordinates (it is much less error prone, composing sub-morphologies is easy, etc.) but it is obviously less efficient computationally.
The current version is really inefficient and does the several calculations more often than necessary. It also stores everything as Quantity objects, which makes simple operations such as additions or getting single elements relatively costly. For small morphologies (only the number of sections matters) this is not noticeable, but it can make for example plotting of reconstructed morphologies so slow that it becomes unusable (see brian-team/brian2tools#13).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment