Opened 7 years ago
Last modified 6 years ago
#2858 new enhancement
UI updates related to results take significant time even when results tab is not shown
Reported by: | gkronber | Owned by: | |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 3.3.17 |
Component: | Optimization.Views | Version: | |
Keywords: | Cc: |
Description
Reproduce
- Open and run GA-TSP sample without showing the results. Execution time ~7sec
- Open and run GA-TSP sample showing the results tab. Execution time ~15sec
- Change AlgorithmView to never set the Content for the results tab. Execution time ~3sec
protected override void OnContentChanged() { base.OnContentChanged(); if (Content == null) { parameterCollectionView.Content = null; problemViewHost.Content = null; resultsView.Content = null; runsView.Content = null; storeAlgorithmInEachRunCheckBox.Checked = true; } else { parameterCollectionView.Content = Content.Parameters; problemViewHost.ViewType = null; problemViewHost.Content = Content.Problem; --> // resultsView.Content = Content.Results.AsReadOnly(); runsView.Content = Content.Runs; storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; } }
A solution would be to check which tab is currently active and set the content to null for each ViewHost which is currently not visible. A sketch is given below. Additionally, it would be necessary to also update all embedded ViewHosts, especially the ViewHost showing the value of the selected result.
protected override void OnContentChanged() { base.OnContentChanged(); if (Content == null) { parameterCollectionView.Content = null; problemViewHost.Content = null; resultsView.Content = null; runsView.Content = null; storeAlgorithmInEachRunCheckBox.Checked = true; } else { if (tabControl.SelectedTab == problemTabPage) { problemViewHost.Content = Content.Problem; } else if (tabControl.SelectedTab == parametersTabPage) { parameterCollectionView.Content = Content.Parameters; } else if (tabControl.SelectedTab == resultsTabPage) { resultsView.Content = Content.Results.AsReadOnly(); } else if (tabControl.SelectedTab == runsTabPage) { runsView.Content = Content.Runs; } storeAlgorithmInEachRunCheckBox.Checked = Content.StoreAlgorithmInEachRun; } } ... private void tabControl_Selected(object sender, TabControlEventArgs e) { if (Content == null) return; if (e.TabPage == problemTabPage) { problemViewHost.Content = Content.Problem; } else if(e.TabPage == parametersTabPage) { parameterCollectionView.Content = Content.Parameters; } else if(e.TabPage == resultsTabPage) { resultsView.Content = Content.Results.AsReadOnly(); } else if(e.TabPage == runsTabPage) { runsView.Content = Content.Runs; } }
Change History (1)
comment:1 Changed 6 years ago by gkronber
- Milestone changed from HeuristicLab 3.3.16 to HeuristicLab 3.3.17
Note: See
TracTickets for help on using
tickets.