#14493 Speed up deleting a summary ensemble - #14494
Merged
Merged
Conversation
kriben
approved these changes
Aug 10, 2026
…eted The destructor called updateReferringCurveSets(), which runs loadDataAndUpdate() on every referring curve set. At that point the summary cases are already deleted, so reloading the curve data has nothing to read. The reload also syncs UI fields, reloads the curve filters, rebuilds the address list, recomputes statistics over an empty case set and updates three legends, and it calls updateAll() on the parent plot once per curve set instead of once per plot. Add clearReferringCurveSets(), which deletes the ensemble and statistics curves directly and updates each affected plot once. For an ensemble with many realizations spread over several curve sets in the same plot this removes most of the work done while deleting. Query the referring objects as RimEnsembleCurveSet instead of walking all referring objects and casting. The previous loop discarded everything that was not a curve set, so the behavior is unchanged.
…mary ensemble deleteSummaryCaseCollection() looped over every case in the ensemble, and for each case scanned every summary plot and called updateConnectedEditors() on every multi plot. For an ensemble with many realizations this scanned each plot once per realization, and updated the connected editors once per realization and multi plot. This showed up as a hot spot in the profiler. Replace deleteCurvesAssosiatedWithCase() with deleteCurvesAssosiatedWithCases(), which takes a set of cases and returns whether anything was deleted. Each plot is now scanned once, and the connected editors of a multi plot are updated only when that multi plot actually lost a curve. RicCloseSummaryCaseFeature and RicCloseObservedDataFeature are updated to the new signature. RicCloseSummaryCaseFeature also scans each plot once instead of once per case.
magnesj
force-pushed
the
summary-ensemble-clear-curve-sets
branch
from
August 10, 2026 09:20
4799dc1 to
eb1af64
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting a summary ensemble did work proportional to the number of realizations, in two independent places. Fixes #14493.
Measured
Deleting an ensemble from a project with many plots, in the running application. Before is
2322d9e97fon dev.deleteSummaryCaseCollection~RimSummaryEnsembleBefore the change the two sections account for 3.4 s of the 3.5 s total, so nothing significant sits outside them. See #14493 (comment) for the full notes.
Delete curves for all cases in one pass
deleteSummaryCaseCollection()looped over every case, and for each case scanned every summary plot and calledupdateConnectedEditors()on every multi plot. Each plot was scanned once per realization, and the connected editors were updated once per realization and multi plot.deleteCurvesAssosiatedWithCase()is replaced bydeleteCurvesAssosiatedWithCases(), which takes a set of cases and returns whether anything was deleted. Each plot is scanned once, and the connected editors of a multi plot are updated only when that multi plot actually lost a curve.This drops to 0 ms because nothing matches. The realization curves belong to
RimEnsembleCurveSet::m_realizationCurves, not to the plot'sRimSummaryCurveCollection::m_curves, so no curve is deleted and no editor is updated. Before the change, that same empty result cost 2.1 s.RicCloseSummaryCaseFeatureandRicCloseObservedDataFeatureare updated to the new signature.RicCloseSummaryCaseFeaturealso scans each plot once instead of once per case.Clear the referring curve sets instead of reloading them
~RimSummaryEnsemble()deletes the cases and then callsupdateReferringCurveSets(), which runsRimEnsembleCurveSet::loadDataAndUpdate()on every referring curve set. Calling it after the cases are deleted is intentional, the curve sets are meant to end up empty, but reloading the curve data has nothing to read at that point. The reload also syncs UI fields, reloads the curve filters, rebuilds the address list, recomputes statistics over an empty case set and updates three legends, and it callsupdateAll()on the parent plot once per curve set instead of once per plot.clearReferringCurveSets()deletes the ensemble and statistics curves directly and updates each affected plot once.The referring objects are queried as
RimEnsembleCurveSetinstead of walking all referring objects and casting. The previous loop discarded everything that was not a curve set, so the behaviour is unchanged.curveSet->filterChanged.send()is kept, soRimAbstractCorrelationPlot,RimEnsembleWellLogCurveSetandRimEnsembleSurfacestill get the same notification as before. Sending a filter change while the ensemble is being deleted is questionable and it is the first thing to try if the remaining 704 ms is worth chasing, but removing it is a behaviour change and is left out of this fix.Note
This touches
~RimSummaryEnsemble()and so conflicts with #14492, which replacesm_cases.deleteChildrenAsync()withm_cases.deleteChildren()in the same destructor. The resolution is to keep both changes, they are independent.A dozen other types hold a
PdmPtrField<RimSummaryEnsemble*>, among themRimAnalysisPlotDataEntry,RimParameterRftCrossPlot,RimRftTornadoPlot,RimOpmFlowJoband the ensemble histogram data sources. None of them are notified when the ensemble is deleted, before or after this change.