SpikeInterface / SpikeInterface/spikeinterface

Improve memory efficiency of `get_chunk_with_margin`

Open
#2,859 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core performance
Dominant language
Python
Stars
847
Forks
280
Avg merge
3d 9h
Merged PRs (30d)
29

Description

This part of the code is really bad. It is consistently breaking a job of mine because it multiplies memory usage by five. It should be made efficient:

https://github.com/SpikeInterface/spikeinterface/blob/cec72f40152b4e7d2e36b979b6769bbdb6d91c11/src/spikeinterface/core/recording_tools.py#L770-L801

Judicious use of the out property can improve this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/spikeinterface/core/recording_tools.py at get_chunk_with_margin, lines 770-801, and inspect how the out property could affect memory use. Confirm the change improves the reported memory multiplication while preserving the function's existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.