Skip to content
Snippets Groups Projects

CommonMessaging - Improved inlining and branch predicition

This MR includes a minor change to CommonMessaging.h designed to improve the runtime performance of CommonMessaging::setUpMessaging(), which is quite heavily called, by making a few trivial changes.

  • The method CommonMessaging::setUpMessaging() is split in two, moving the part that is infrequently called to a new private method. This makes the footprint of CommonMessaging::setUpMessaging() much smaller and consequently improves the likelihood of it being inlined.
  • I added an UNLIKELY( ) hint around the !m_commonMessagingReady to help the compiler better optimise the check branch prediction.

Together these MRs address a small performance regression I recently noticed, most likely due to !566 (merged). See the callgrind heat maps below for the cost of a given algorithm call, before and after the change.

Before : before

After: after

Edited by Christopher Rob Jones

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 9 commits

    Compare with previous version

  • mentioned in merge request lhcb/Rec!889 (merged)

  • Marco Clemencic changed milestone to %v29r3

    changed milestone to %v29r3

  • Marco Clemencic resolved all discussions

    resolved all discussions

  • Marco Clemencic changed milestone to %v30r2

    changed milestone to %v30r2

  • Hadrien Benjamin Grasland approved this merge request

    approved this merge request

  • assigned to @leggett

  • Does gitlab automatically squash all redundant merge commits? In the end, this MR is only 1 relevant commit, and not 102... would be good to avoid adding 101 redundant commits to the master...

  • No, unless you tick the "squash" checkbox before merging. Another possibility is to rebase.

  • added 28 commits

    • c7aed820...5746b2fc - 27 commits from branch gaudi:master
    • 0e1ef223 - Rework CommonMessaging::setUpMessaging() to improve runtime performance by…

    Compare with previous version

  • Apologies... Have rebased so commit history is clean now.

  • Hadrien Benjamin Grasland approved this merge request

    approved this merge request

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading