Skip to content

DigitalWaveform.signals introduces a reference cycle #131

@bkeryan

Description

@bkeryan

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.

AB#3178116

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech debtNon-user-visible improvement to code or development process

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions