Skip to content
New issue

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

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

Already on GitHub? # to your account

Runtime of PopulationView.id_to_index() has > n^2 scaling with number of cell parameters #693

Open
AvidusMauch opened this issue Nov 26, 2020 · 0 comments
Milestone

Comments

@AvidusMauch
Copy link

AvidusMauch commented Nov 26, 2020

PopulationTest.test_scaling_cellparams_id_to_index from #691 shows that PopulationView.id_to_index() scales > n^2.
relevant line a58cc51#diff-fb732f5879c60a0dc39fffe1a1bb8fbc45c3299c0197baec8e942cf69b871df5R110
The line of code where most time is spent is

result = numpy.where(self.all_cells == id)[0]

if IDMixin is not assignend its Population as parent this scaling is not observed
As Population.id_to_index()'s implementation does not use numpy.where() it also does not scale with number of cell parameters

@apdavison apdavison added this to the 0.10.0 milestone Dec 22, 2020
muffgaga pushed a commit to electronicvisions/pynn-brainscales that referenced this issue Jun 16, 2021
* In the previous implementation, the recorded neuron was searched
  for twice. We now search once – and only if we actually want to
  record.
* Comparing cell_ids as integers is faster than using the ID Mixin
  in upstream pyNN.
  (see NeuralEnsemble/PyNN#693)

Change-Id: Ife482d0a2bdd0e241b2cdc037ef40bde51821037
@apdavison apdavison modified the milestones: 0.10.0, 0.10.1 Mar 21, 2022
@apdavison apdavison modified the milestones: 0.10.1, 0.10.2 Oct 13, 2022
@apdavison apdavison modified the milestones: 0.10.2, 0.11.0 Feb 5, 2023
@apdavison apdavison modified the milestones: 0.11.0, 0.13.0 Feb 21, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants