|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CPU bottleneckHello,
I have a app that reads data from a serial port and then does some pretty basic sorting. My problem is that the CPU usage get to 50-60% during this. What is the correct methodology to find where the bottlenecks might be. I'm using VS2005 Thanks Mike Mike,
Based on what you said, I don't think you have a problem. Just because you have a CPU utilization of 50-60% doesn't mean that you have a bottleneck, or that it's a bad thing. Now, if you had said that you are seeing degraded performance of your app (based against the expectations of the app, again, you have to have something to compare it to, you can't just want it to be faster), then that's a different story. All that being said, I would look into getting VS.NET 2008 and using some of the profile tools in that to see where your bottlenecks lie. There are some third party tools as well (and I can't remember if the profiler is in VS.NET 2005 as well), but a profiler of any sort is the way to go here, IMO. -- Show quoteHide quote- Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "AMP" <ampel***@gmail.com> wrote in message news:165802ee-6829-47b8-8f3c-533840ab0945@17g2000vbf.googlegroups.com... > Hello, > I have a app that reads data from a serial port and then does some > pretty basic sorting. > My problem is that the CPU usage get to 50-60% during this. > What is the correct methodology to find where the bottlenecks might > be. > I'm using VS2005 > Thanks > Mike On Dec 15, 12:11 pm, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guard.caspershouse.com> wrote: Show quoteHide quote > Mike, Where is the profiler in 08?> > Based on what you said, I don't think you have a problem. Just because > you have a CPU utilization of 50-60% doesn't mean that you have a > bottleneck, or that it's a bad thing. > > Now, if you had said that you are seeing degraded performance of your > app (based against the expectations of the app, again, you have to have > something to compare it to, you can't just want it to be faster), then > that's a different story. > > All that being said, I would look into getting VS.NET 2008 and using > some of the profile tools in that to see where your bottlenecks lie. There > are some third party tools as well (and I can't remember if the profiler is > in VS.NET 2005 as well), but a profiler of any sort is the way to go here, > IMO. > > -- > - Nicholas Paldino [.NET/C# MVP] > - m...@spam.guard.caspershouse.com > > "AMP" <ampel***@gmail.com> wrote in message > > news:165802ee-6829-47b8-8f3c-533840ab0945@17g2000vbf.googlegroups.com... > > > > > Hello, > > I have a app that reads data from a serial port and then does some > > pretty basic sorting. > > My problem is that the CPU usage get to 50-60% during this. > > What is the correct methodology to find where the bottlenecks might > > be. > > I'm using VS2005 > > Thanks > > Mike- Hide quoted text - > > - Show quoted text - Mike,
Look under the "Analyze" menu item. This is for Team System, I don't know if the professional or other editions have this, you will have to check. There are still some third party tools that will help though, just google ".NET profiler" and that should turn up some results. -- - Nicholas Paldino [.NET/C# MVP] - mvp@spam.guard.caspershouse.com "AMP" <ampel***@gmail.com> wrote in message On Dec 15, 12:11 pm, "Nicholas Paldino [.NET/C# MVP]"news:d209f6db-fb99-4c7f-9cd0-255f5a6aee6d@e1g2000pra.googlegroups.com... <m...@spam.guard.caspershouse.com> wrote: Show quoteHide quote > Mike, Where is the profiler in 08?> > Based on what you said, I don't think you have a problem. Just because > you have a CPU utilization of 50-60% doesn't mean that you have a > bottleneck, or that it's a bad thing. > > Now, if you had said that you are seeing degraded performance of your > app (based against the expectations of the app, again, you have to have > something to compare it to, you can't just want it to be faster), then > that's a different story. > > All that being said, I would look into getting VS.NET 2008 and using > some of the profile tools in that to see where your bottlenecks lie. There > are some third party tools as well (and I can't remember if the profiler > is > in VS.NET 2005 as well), but a profiler of any sort is the way to go here, > IMO. > > -- > - Nicholas Paldino [.NET/C# MVP] > - m...@spam.guard.caspershouse.com > > "AMP" <ampel***@gmail.com> wrote in message > > news:165802ee-6829-47b8-8f3c-533840ab0945@17g2000vbf.googlegroups.com... > > > > > Hello, > > I have a app that reads data from a serial port and then does some > > pretty basic sorting. > > My problem is that the CPU usage get to 50-60% during this. > > What is the correct methodology to find where the bottlenecks might > > be. > > I'm using VS2005 > > Thanks > > Mike- Hide quoted text - > > - Show quoted text - On Mon, 15 Dec 2008 09:11:30 -0800, Nicholas Paldino [.NET/C# MVP]
<mvp@spam.guard.caspershouse.com> wrote: > Based on what you said, I don't think you have a problem. Just It's true that there's not _necessarily_ a problem. And of course, > because > you have a CPU utilization of 50-60% doesn't mean that you have a > bottleneck, or that it's a bad thing. there's always going to be a "bottleneck" somewhere. By definition, _some_ part of the code will be the slowest, and thus the bottleneck. But, CPU utilization of 50% during i/o may well be a problem, simply because i/o shouldn't be consuming much CPU time at all, and having CPU utilization of 50% (or nearly) is highly suggestive of a single thread on a dual-core/CPU PC (quite common these days) running a full bore. When this happens during i/o, that suggests that the i/o is being done using polling, which is _bad_. Of course, the original poster asked a question about his code without posting his code, making it impossible to actually answer the question. We can't know whether or not he's got a problem, because there are in fact legitimate reasons the CPU utilization might be so high. But playing the odds, chances are good there's a bug. Pete
Other interesting topics
|
|||||||||||||||||||||||