Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • athena athena
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Jira
    • Jira
  • Merge requests 142
    • Merge requests 142
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Commits
Collapse sidebar
  • atlas
  • athenaathena
  • Merge requests
  • !23814

Remove un-needed std::string allocations from GsfExtrapolator , when Not running in DEBUG

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Christos Anastopoulos requested to merge ATLAS-EGamma/athena:GaussianSumFilter_no_string_alloc into master May 29, 2019
  • Overview 2
  • Commits 1
  • Pipelines 1
  • Changes 1

This class has a method printState that when in Debug prints relevant info

void Trk::GsfExtrapolator::printState( const std::string& description, 
const Trk::TrackParameters& trackParameters ) const
 {
 std::string label = description + " (r,phi,z), (phi, theta, q/p):\t(";
   ATH_MSG_DEBUG( label
      << trackParameters.position().perp() << ", " << trackParameters.position().phi() 
     ........

By calling it you end up allocating one std::string even if you print nothing (i.e when not in DEBUG). Typically , it was called inside if statements checking we are in DEBUG mode. But not always as one can see from a e/gamma profile of running over 20 events.

Screenshot_2019-05-29_at_19.04.19

It is not a huge gain obviously but it took me some time to figure why one will allocate std::string from the GsfExtrapolator in production mode...

@amorley I guess we could clean up or make these facilites better . For now just move them inside the if DEBUG statements.

Edited May 29, 2019 by Christos Anastopoulos
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: GaussianSumFilter_no_string_alloc