|Anonymous | Login | Signup for a new account||2018-12-18 09:08 PST|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0007274||ardour||bugs||public||2017-03-07 03:51||2017-04-23 16:00|
|Target Version||Fixed in Version||5.X git (version in description)|
|Summary||0007274: Loading Session with selected regions can take a really long time|
|Description||Tested with version 5.8.76 + logging/tracing patches|
In a moderate size session with several hundred regions if the Session is saved with many selected regions then the Session can take a very long time to load
compared to without a region selection (5 seconds vs 60+ seconds) depending on the number of regions selected.
As part of Editor::first_idle region/views that are selected are added to the region selection one region at a time calling Selection::add. Selection::add emits a signal that is connected to Editor::region_selection_changed that calls Editor::sensitize_the_right_region_actions which itself is > O(n2) as it iterates through the RegionSelection calling Region::at_natural_position which calls Session::find_whole_file_parent which also iterates through all the regions in the Session AFAICT. So the whole process ends up being > O(n3).
It is also an issue for normal region selection in that Editor::sensitize_the_right_region_actions is called, but at least only once.
It is probably just easier to understand by looking at log/trace file I've attached that can be viewed with chrome/ium://tracing
|Tags||No tags attached.|
|Attached Files|| Ardour.trace.load-session-with-region-selection.json.tar.xz [^] (3,049,596 bytes) 2017-03-07 03:51|
Ardour-5.8.533-split-region-with-selection-undo.json.gz [^] (1,173,315 bytes) 2017-04-20 05:10
7274-fix-freeze-on-undo.patch [^] (936 bytes) 2017-04-23 04:23 [Show Content]
|should be much improved since f31e938da0|
|I can't find a commit with that id in the master branch. Are you are sure that is correct? or is it located somewhere else?|
|sorry, had not rebased or pushed. it is 54bab5153f1cb|
Testing with a build of 54bab5153 and the load time is now much reduced.
I did notice though that after selecting a region and deleting it then undoing the action will no longer result in the region begin re/selected.
There seems to be a related issue that I can reproduce in 5.8.236 and 5.8.533.
Steps to reproduce:
1. Create or open a Session with many regions. Several hundred should make the issue noticable.
2. Select all the regions in the Session.
3. Split a region using split tool or 's' key.
4. Undo the Split.
Result: Depending on the amount of Regions in the Session the application will freeze for a period of time, several seconds to perhaps minutes depending on number of Regions selected.
I've attached another trace/log that makes it apparent it is a similar issue with regions being added individually to the selection.
I've attached a patch that should fix the issue mentioned in the last comment.
It feels like more of a workaround as there is still the issues with Editor::sensitize_the_right_region_actions
|I can commit the fix if there is some agreement that this is an acceptable solution for now.|
|patch looks ideal to me. it won't even conflict with the "selection2" branch. please commit it.|
|that said, there is another approach ... but i think they are 6 of 1, half a dozen of the other; put a PresentationInfo::ChangeSuspender in scope while the regions are added to the selection.|
OK, well I've pushed the patch to master as 1b2bc203a or nightly build >= 5.8.574
I'm marking this issue as resolved.
|2017-03-07 03:51||timbyr||New Issue|
|2017-03-07 03:51||timbyr||File Added: Ardour.trace.load-session-with-region-selection.json.tar.xz|
|2017-04-02 10:37||paul||Note Added: 0019582|
|2017-04-02 15:28||timbyr||Note Added: 0019584|
|2017-04-02 15:34||paul||Note Added: 0019585|
|2017-04-02 17:59||timbyr||Note Added: 0019589|
|2017-04-20 05:10||timbyr||Note Added: 0019615|
|2017-04-20 05:10||timbyr||File Added: Ardour-5.8.533-split-region-with-selection-undo.json.gz|
|2017-04-23 04:23||timbyr||File Added: 7274-fix-freeze-on-undo.patch|
|2017-04-23 04:29||timbyr||Note Added: 0019625|
|2017-04-23 04:31||timbyr||Note Added: 0019626|
|2017-04-23 10:04||paul||Note Added: 0019629|
|2017-04-23 10:05||paul||Note Added: 0019630|
|2017-04-23 15:59||timbyr||Note Added: 0019635|
|2017-04-23 16:00||timbyr||Status||new => resolved|
|2017-04-23 16:00||timbyr||Fixed in Version||=> 5.X git (version in description)|
|2017-04-23 16:00||timbyr||Resolution||open => fixed|
|2017-04-23 16:00||timbyr||Assigned To||=> timbyr|
|Copyright © 2000 - 2018 MantisBT Team|