Commit b119e5d3 authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Stopped xAODWriterAlg from re-creating the output object type names on every event.

It was wasteful to call SG::normalizedTypeinfoName(...) as many times as the code did.
Now the algorithm just caches the type names of the written objects. Trading a little
bit of memory for less CPU cycles.


Former-commit-id: 7602a2433b08be69caa04fe10a4f17d734e515a2
parent b3a3e836
......@@ -94,8 +94,7 @@ namespace CP {
}
// Record it to the output for the current event.
ANA_CHECK( m_event.record( const_cast< void* >( obj ),
SG::normalizedTypeinfoName( *( item.type ) ),
ANA_CHECK( m_event.record( const_cast< void* >( obj ), item.typeName,
item.name, m_basketSize, m_splitLevel ) );
}
......@@ -174,6 +173,7 @@ namespace CP {
<< itemMatch[ 1 ] << "\"" );
return StatusCode::FAILURE;
}
item.typeName = SG::normalizedTypeinfoName( *( item.type ) );
// Check if the item is available.
static const bool SILENT = true;
......
......@@ -70,6 +70,8 @@ namespace CP {
std::string name;
/// Type of the written object
const std::type_info* type;
/// Type name of the written object
std::string typeName;
}; // struct Item
/// Object to write the output file with
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment