Skip to content

Replace samples with batches of samples in the data pipeline #348

@matthias-wende-frequenz

Description

What's needed?

We have designed the flow of data inside the sdk's data pipeline such that each sample is handled individually. That implies that in each node of a frequenz-sdk data pipeline we're having an async context switch which eventually lead to poor performance.

We can generalize this concept when replacing the role of the Sample in the data pipeline with a batch of samples. When setting the batch size to one we're getting the current approach as a special case.

The advantage is that in certain cases we can fill up a batch with a fixed number of samples.

The batch size might be adaptable depending on e.g. the incoming sample period and the resampling period.

Proposed solution

In a first step we can introduce a batch type that represents a list of samples and update all parts of the data pipeline accordingly.
That opens space for performance optimizations that can be addressed in succeeding steps.

Use cases

  • increase the band with of the data pipeline
  • reduce number of context switches in e.g. the resampler
  • reading historical data from disc

Metadata

Metadata

Assignees

No one assigned

    Labels

    part:coreAffects the SDK core components (data structures, etc.)part:data-pipelineAffects the data pipelinepriority:lowThis should be addressed only if there is nothing else on the tabletype:enhancementNew feature or enhancement visitble to users

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions