ChimeraTK / ChimeraTK/ControlSystemAdapter-DoocsAdapter

Improve performance of DoocsUpdater

Open
#29 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
0
Forks
1
Avg merge
23h 29m
Merged PRs (30d)
1

Description

This is basically a follow-up of #14, but the scope goes beyond ZeroMQ and macro pulse numbers.

There are various points in which the DoocsUpdater could be optimised for performance:

  • Locking scheme: filling locationsToLock requires a lot of cpu and involves even memory allocation.
  • There are two maps with a map lookup for the updatedElement. This can be packed into a single map, so there is only one lookup.
  • Avoid calls to updaterFunction() when possible: This can be achieved by moving the DataConsistencyGroup into DoocsTransferElement so it can be directly accessed in the DoocsUpdater::updateLoop(). If the DataConsistencyGroup says there is no consistent update to process, there is no need to call the updaterFunction().
  • Maybe replacing the functor objects for the updaterFunction() with a virtual function call in DoocsTransferElement is more efficient?

DoD:

  • Try out all of the above potential optimisations. Check if they improve something with a profiler (e..g vTune).
  • Keep an optimisation unless it makes the performance worse, or it makes the code much more complicated / less readable and there is no gain.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating DoocsUpdater, DoocsTransferElement, and the updateLoop, then establish a profiler baseline such as with vTune. Investigate the locking scheme, the two updatedElement maps, updaterFunction calls, and functor versus virtual dispatch as separate experiments. Done means all proposed optimisations were tested and only changes with measurable gains and acceptable readability remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.