DigitalWaveform.signals introduces a reference cycle
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Tech Debt
There is a reference cycle between DigitalWaveform and DigitalWaveformSignal/DigitalWaveformSignalCollection. Python normally uses reference counting to free objects, but it also has a generational GC that can clean up reference cycles, and apparently this can affect application performance.
We should evaluate whether to use weakref to break this cycle, and if so, how.
- Should the parent->child link be a weak ref? The parent caches the children and can reconstruct them if needed.
- Should the child->parent link be a weak ref? Once this is invalidated, the child object is unusable, but many use cases will reference the parent.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing references among DigitalWaveform, DigitalWaveformSignal, and DigitalWaveformSignalCollection. Compare the parent-to-child and child-to-parent ownership options described in the issue, then determine whether weakref can break the cycle without making common child usage invalid. Done means the ownership strategy is decided and its performance implications are evaluated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100