From 9cac17ea7d75a4d9ecfa05ba6d47c1e44d5cf9cc Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Tue, 8 Mar 2022 16:15:15 +0100 Subject: [PATCH] Speed up silence-stripping when there are many silent chunks Previously every region fragment was added one at a time, with each emitting signals and updating the GUI. If there are a few thousand regions Ardour can freeze for a significant amount of time. There is still the issue that the GUI freezes after the progress-bar reached the end: consolidate overlapping ranges after analysis, then add regions. And Playlist::flush_notifications still emits RegionFactory::CheckNewRegion() for every region individually and RegionListBase::add_region becomes the bottleneck. But at least adding 7k regions now returns in under 5 minutes instead of taking over an hour. --- gtk2_ardour/editor_ops.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index 3a57ae8fd7..b1a06b8c23 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -6131,6 +6131,7 @@ Editor::apply_filter (Filter& filter, string command, ProgressReporter* progress } else { + playlist->freeze (); std::vector >::iterator res = filter.results.begin (); /* first region replaces the old one */ @@ -6142,6 +6143,7 @@ Editor::apply_filter (Filter& filter, string command, ProgressReporter* progress playlist->add_region (*res, (*res)->position()); ++res; } + playlist->thaw (); }