Skip to content
This repository was archived by the owner on Apr 20, 2020. It is now read-only.
This repository was archived by the owner on Apr 20, 2020. It is now read-only.

OperatorWrapper causes slowness and high memory consumption #175

@burgerdev

Description

@burgerdev

In principle, the OperatorWrapper class was a neat concept, but I think we are at a point where it hinders us more than it helps. It is (at least partially) responsible for the problems in ilastik/ilastik#1075 and ilastik/ilastik#718, i.e. terrible usage of workflows with many time slices or many lanes.

The problem:

  • creation of many operators, of which only few are used simultaneously
    • memory problems
  • big trees of setupOutputs() and propagateDirty() calls
    • slowness (e.g. after adding new labels in PC)

The problem was 'solved' in some places by putting a custom for-loop in execute which loops over time slices (see opLabelVolume.OpLabelingABC for real world example):

class Op(Operator):
    def execute(self, slot, subindex, roi, result):
        for t in range(roi.start[0], roi.stop[0]):
            self.operate(roi, result[t:t+1, ...])

Can we do it a bit more general than this? It would also be nice if we did not have to rewrite all occurences of OperatorWrapper... What comes to my mind is either lazy allocation of inner operators, or a special operator type StatelessOperator which can be reused inside wrappers.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions