Browse Source

Performance tweak - call Application.DoEvents() before refreshing local variables pad.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2904 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
8f57b8295c
  1. 4
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs
  2. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Util.cs

4
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

@ -223,13 +223,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -223,13 +223,13 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
public override void RefreshPad()
{
Debugger.AddIn.TreeModel.Util.ResetDoEventsStartTime();
Debugger.AddIn.TreeModel.Util.ForceDoEvents();
DateTime start = Debugger.Util.HighPrecisionTimer.Now;
try {
if (debuggedProcess != null && debuggedProcess.SelectedStackFrame != null) {
TreeViewNode.SetContentRecursive(this, localVarList.Root.Children, new StackFrameNode(debuggedProcess.SelectedStackFrame).ChildNodes);
} else {
TreeViewNode.SetContentRecursive(this, localVarList.Root.Children, null);
//TreeViewNode.SetContentRecursive(this, localVarList.Root.Children, null);
}
} catch(AbortedBecauseDebugeeStateExpiredException) {
LoggingService.Info("Aborted variable refresh because debugee state expired");

8
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/TreeModel/Util.cs

@ -20,13 +20,19 @@ namespace Debugger.AddIn.TreeModel @@ -20,13 +20,19 @@ namespace Debugger.AddIn.TreeModel
static DateTime nextDoEventsTime = Debugger.Util.HighPrecisionTimer.Now;
const double workLoad = 0.75; // Fraction of getting variables vs. repainting
const double maxFPS = 30; // this prevents too much drawing on good machine
const double maxWorkTime = 250; // ms this ensures minimal response on bad machine
const double maxWorkTime = 150; // ms this ensures minimal response on bad machine
public static void ResetDoEventsStartTime()
{
nextDoEventsTime = Debugger.Util.HighPrecisionTimer.Now.AddMilliseconds(1000 / maxFPS);
}
public static void ForceDoEvents()
{
nextDoEventsTime = DateTime.MinValue;
DoEvents();
}
public static void DoEvents()
{
if (Debugger.Util.HighPrecisionTimer.Now > nextDoEventsTime) {

Loading…
Cancel
Save