Skip to content

Publish predicates only on value change #122

@domire8

Description

@domire8

Currently, predicates are published at a fixed rate (component rate, or hardcoded rate for controllers) as well as on set_predicate(). It would be much more efficient to only publish predicates on change.

I present here three options in order of preference (last one is the highest one):

  1. Drop the option of providing a functor as a predicate and just store the current predicate value in one single map. This would require derived components to always use set_predicate in order to set a predicate value. The advantage of this option is that only one map is required. The disadvantage is that we would remove a neat feature that is being used in multiple components.
  2. Naive approach: simply add a second map that holds the previous predicate value and only publish if the new value is different from the old one.
  3. Naive approach, in better: add a second map that holds the previous predicate value and only publish if the new value is different from the old one. Additionally, wrap all predicates in a functor, e.g. drop the PredicateVariant in order to make the get_predicate function slightly faster.

@bpapaspyros @eeberhard

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions