Analyzing Forms application with strange results
Susanne
Posts: 2
Hi
I just started working with ANTS Profiler. I try to analyze a Windows Forms application with Oracle data base connected. There are some use cases which take some seconds for the user to wait for the result. I bookmarked them. Most of the time spent for an user interaction seems to be spent in framework or system code. So I don't really see a way to improove the code. I've marked the most expensive line in red (DispatchMessageW). Here is the Call tree, CPU time, Percentages.
Test.Program.Main () <0.001 99.935
System.Windows.Forms.Application+ThreadContext.RunMessageLoop (int reason, ApplicationContext context) <0.001 99.935
System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner (int reason, ApplicationContext context) <0.001 99.935
System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (int dwComponentID, int reason, int pvLoopData) 0.694 99.935
Transition to unmanaged code... 0.129 98.882
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW (NativeMethods+MSG msg) 58.757 95.776
Transition to managed code... 0.002 37.020
System.Windows.Forms.NativeMethods+WndProc.Invoke (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) 0.016 37.017
System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) 0.008 37.001
System.Windows.Forms.Control+ControlNativeWindow.WndProc (Message m) 0.006 36.988
System.Windows.Forms.ToolStripDropDown.WndProc (Message m) <0.001 33.019
System.Windows.Forms.ToolStrip.WndProc (Message m) <0.001 33.019
System.Windows.Forms.Control.WndProc (Message m) 0.001 33.018
System.Windows.Forms.Control.WmMouseUp (Message m, MouseButtons button, int clicks) 0.032 29.577
System.Windows.Forms.ToolStripDropDown.OnMouseUp (MouseEventArgs mea) <0.001 29.417
System.Windows.Forms.ToolStrip.OnMouseUp (MouseEventArgs mea) <0.001 29.417
System.Windows.Forms.ToolStripItem.HandleMouseUp (MouseEventArgs e) 0.002 29.416
System.Windows.Forms.ToolStripItem.HandleClick (EventArgs e) 0.008 29.405
System.Windows.Forms.ToolStripMenuItem.OnClick (EventArgs e) <0.001 28.728
System.Windows.Forms.ToolStripItem.RaiseEvent (object key, EventArgs e) 0.010 28.727
Test.Modul.test_Click (object sender, EventArgs e) 0.054 28.621
When I switch to Wall-clock time there is about 25% sleeping, 25% Waiting for synchroniziation, 25% System.Threading...PerformWaitCallback(...), 25% for the programm path as printed above. When I switch to Seconds the total time in each section is the total time of my bookmarked region. So I am not sure what to reason from those information.
I hope you can give me some advice on how to proceed. Thanks
Susanne
I just started working with ANTS Profiler. I try to analyze a Windows Forms application with Oracle data base connected. There are some use cases which take some seconds for the user to wait for the result. I bookmarked them. Most of the time spent for an user interaction seems to be spent in framework or system code. So I don't really see a way to improove the code. I've marked the most expensive line in red (DispatchMessageW). Here is the Call tree, CPU time, Percentages.
Test.Program.Main () <0.001 99.935
System.Windows.Forms.Application+ThreadContext.RunMessageLoop (int reason, ApplicationContext context) <0.001 99.935
System.Windows.Forms.Application+ThreadContext.RunMessageLoopInner (int reason, ApplicationContext context) <0.001 99.935
System.Windows.Forms.Application+ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop (int dwComponentID, int reason, int pvLoopData) 0.694 99.935
Transition to unmanaged code... 0.129 98.882
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW (NativeMethods+MSG msg) 58.757 95.776
Transition to managed code... 0.002 37.020
System.Windows.Forms.NativeMethods+WndProc.Invoke (IntPtr hWnd, int msg, IntPtr wParam, IntPtr lParam) 0.016 37.017
System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, int msg, IntPtr wparam, IntPtr lparam) 0.008 37.001
System.Windows.Forms.Control+ControlNativeWindow.WndProc (Message m) 0.006 36.988
System.Windows.Forms.ToolStripDropDown.WndProc (Message m) <0.001 33.019
System.Windows.Forms.ToolStrip.WndProc (Message m) <0.001 33.019
System.Windows.Forms.Control.WndProc (Message m) 0.001 33.018
System.Windows.Forms.Control.WmMouseUp (Message m, MouseButtons button, int clicks) 0.032 29.577
System.Windows.Forms.ToolStripDropDown.OnMouseUp (MouseEventArgs mea) <0.001 29.417
System.Windows.Forms.ToolStrip.OnMouseUp (MouseEventArgs mea) <0.001 29.417
System.Windows.Forms.ToolStripItem.HandleMouseUp (MouseEventArgs e) 0.002 29.416
System.Windows.Forms.ToolStripItem.HandleClick (EventArgs e) 0.008 29.405
System.Windows.Forms.ToolStripMenuItem.OnClick (EventArgs e) <0.001 28.728
System.Windows.Forms.ToolStripItem.RaiseEvent (object key, EventArgs e) 0.010 28.727
Test.Modul.test_Click (object sender, EventArgs e) 0.054 28.621
When I switch to Wall-clock time there is about 25% sleeping, 25% Waiting for synchroniziation, 25% System.Threading...PerformWaitCallback(...), 25% for the programm path as printed above. When I switch to Seconds the total time in each section is the total time of my bookmarked region. So I am not sure what to reason from those information.
I hope you can give me some advice on how to proceed. Thanks
Susanne