Skip to content

Commit ae6a061

Browse files
authored
Fix Performance issue in GroupDetectors (#39246)
* reserve space for event list * fix variable * add release note * add timing and instrument
1 parent 860b09c commit ae6a061

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Framework/DataHandling/src/GroupDetectors2.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,13 @@ size_t GroupDetectors2::formGroupsEvent(const DataObjects::EventWorkspace_const_
10101010
// Start fresh with no detector IDs
10111011
outEL.clearDetectorIDs();
10121012

1013+
// Reserve space for the event list
1014+
std::size_t totalEvents = 0;
1015+
for (auto i : it->second) {
1016+
totalEvents += inputWS->getSpectrum(i).getNumberEvents();
1017+
}
1018+
outEL.reserve(totalEvents);
1019+
10131020
// the Y values and errors from spectra being grouped are combined in the
10141021
// output spectrum
10151022
// Keep track of number of detectors required for masking
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix issue with :ref:`GroupDetectors <algm-GroupDetectors-v2>` where the algorithm would freeze on large datasets while adding EventList to the Output Workspace. Testing with TOPAZ-50006 execution time was reduced from 2+ hours to ~30 seconds.

0 commit comments

Comments
 (0)