2

I create few methods using in one application, and when I test performance on this methods with visual studio profiler I see the CPU used around 18% and is finish work around 0.04 second.

My question is if in another not so faster computer is used (for example) 30-40% of CPU power, do is have the same time with previous CPU who is used 18% of his power. I'm sorry for my bad English.

Evgeni Velikov
  • 362
  • 3
  • 10
  • 28
  • 3
    There's no hard and fast rule here. If you want to understand how *your* code will perform on a *particular* computer, you pretty well have to measure it on that computer (or an identically specced one). – Damien_The_Unbeliever Nov 11 '15 at 07:15
  • 2
    Do not apologize for your English. English is a difficult language, and it takes courage to speak up as you have. Thank you. Regarding your question, if your program completes in 40 milliseconds, the CPU% is probably meaningless. In a longer-running program, it really only tells you how much time is spent in I/O or other system waits. It doesn't really say anything about the performance of your program. – Mike Dunlavey Nov 11 '15 at 22:13
  • The difference can simply be that the two CPUs have a different core count. A single threaded program will use 50% CPU on a two core CPU and 12,5% on a quad core with Hyper Threading enabled (8 logical cores). Check out with task manager how many logical CPUs you have. – Alois Kraus Jan 24 '16 at 14:36

1 Answers1

0

CPU% is meaningless regarding performance, because when your program is executing it uses 100% of the CPU, and when it is waiting it uses 0%. The displayed CPU% is just an average.

The only thing it might tell you is if your program is more or less I/O-bound.

Sure, the program will run faster or slower on a faster or slower CPU, unless it is I/O-bound. If you are concerned about the speed of the software, you could do what a lot of people do, and that is eliminate all waste in the software itself.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135