On average, of low level games, what is the CPU Usage?
And if I consider this too much, how would I lower it. I know most programs run very low on usage.
Thanks, dnx
CPU Usage
Moderator: Coders of Rage
- Ginto8
- ES Beta Backer
- Posts: 1064
- Joined: Tue Jan 06, 2009 4:12 pm
- Programming Language of Choice: C/C++, Java
Re: CPU Usage
Once again, you're worrying too much about things. In a "minor" game, you will see low-to-mid range CPU usage when it is functioning normally. However, it will be easily visible when it isn't, because you will often see twice as much or more. How to fix an actual issue like that is just to debug your program and find where it goes into an uncontrolled infinite loop.
however, the implied intention of your question is to determine how to squeeze every last cycle out of your program. For this, I would hereby like to present my 2 favorite bits of programming advice: "Premature optimization is the root of all evil." (Donald Knuth) and "When in doubt, use brute force." (Ken Thompson). You are looking to make savings of millisecond amounts, and you aren't doing millions of iterations per second of whatever you're doing. Instead of worrying about trivial things like program size and program performance, which can all be easily fixed later (as long as the bad performance isn't due to a horrible design), you should spend more time designing your software so that you can maintain it without driving yourself insane, reuse code from it, and gain as much information as possible from the experience.
Design is one of the most important parts of software engineering, just as imagination is one of the most important parts of storytelling. Stories can have minor inconsistencies (especially the first time they're told) as long as they aren't critical to the meaning of the story.
however, the implied intention of your question is to determine how to squeeze every last cycle out of your program. For this, I would hereby like to present my 2 favorite bits of programming advice: "Premature optimization is the root of all evil." (Donald Knuth) and "When in doubt, use brute force." (Ken Thompson). You are looking to make savings of millisecond amounts, and you aren't doing millions of iterations per second of whatever you're doing. Instead of worrying about trivial things like program size and program performance, which can all be easily fixed later (as long as the bad performance isn't due to a horrible design), you should spend more time designing your software so that you can maintain it without driving yourself insane, reuse code from it, and gain as much information as possible from the experience.
Design is one of the most important parts of software engineering, just as imagination is one of the most important parts of storytelling. Stories can have minor inconsistencies (especially the first time they're told) as long as they aren't critical to the meaning of the story.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
Re: CPU Usage
+1Ginto8 wrote:Once again, you're worrying too much about things. In a "minor" game, you will see low-to-mid range CPU usage when it is functioning normally. However, it will be easily visible when it isn't, because you will often see twice as much or more. How to fix an actual issue like that is just to debug your program and find where it goes into an uncontrolled infinite loop.
however, the implied intention of your question is to determine how to squeeze every last cycle out of your program. For this, I would hereby like to present my 2 favorite bits of programming advice: "Premature optimization is the root of all evil." (Donald Knuth) and "When in doubt, use brute force." (Ken Thompson). You are looking to make savings of millisecond amounts, and you aren't doing millions of iterations per second of whatever you're doing. Instead of worrying about trivial things like program size and program performance, which can all be easily fixed later (as long as the bad performance isn't due to a horrible design), you should spend more time designing your software so that you can maintain it without driving yourself insane, reuse code from it, and gain as much information as possible from the experience.
Design is one of the most important parts of software engineering, just as imagination is one of the most important parts of storytelling. Stories can have minor inconsistencies (especially the first time they're told) as long as they aren't critical to the meaning of the story.
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: CPU Usage
I'm considerably worried about processing just because I'm not doing much with the game yet. Do you mean that cpu usage is noticeable at the beginnings of development? This doesn't seem logical...Ginto8 wrote:Once again, you're worrying too much about things. In a "minor" game, you will see low-to-mid range CPU usage when it is functioning normally. However, it will be easily visible when it isn't, because you will often see twice as much or more. How to fix an actual issue like that is just to debug your program and find where it goes into an uncontrolled infinite loop.
But as for infinite loops. I only have a continues loop in a thread for game mechanics and such, thread is also closed on exit.
The framework of the actual program is nice and neat I like the way I've organized the design but I'm just worried about the implementations, if their taking up too many resources.Ginto8 wrote:Design is one of the most important parts of software engineering, just as imagination is one of the most important parts of storytelling. Stories can have minor inconsistencies (especially the first time they're told) as long as they aren't critical to the meaning of the story.
- dandymcgee
- ES Beta Backer
- Posts: 4709
- Joined: Tue Apr 29, 2008 3:24 pm
- Current Project: https://github.com/dbechrd/RicoTech
- Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
- Programming Language of Choice: C
- Location: San Francisco
- Contact:
Re: CPU Usage
As soon as you limit the frame rate you'll go from 100% CPU usage to 2% easy. The continuous loop is most certainly the cause.dnxviral wrote:I'm considerably worried about processing just because I'm not doing much with the game yet. Do you mean that cpu usage is noticeable at the beginnings of development? This doesn't seem logical...Ginto8 wrote:Once again, you're worrying too much about things. In a "minor" game, you will see low-to-mid range CPU usage when it is functioning normally. However, it will be easily visible when it isn't, because you will often see twice as much or more. How to fix an actual issue like that is just to debug your program and find where it goes into an uncontrolled infinite loop.
But as for infinite loops. I only have a continues loop in a thread for game mechanics and such, thread is also closed on exit.
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches!
-
- Chaos Rift Cool Newbie
- Posts: 51
- Joined: Tue Dec 14, 2010 6:49 pm
- Favorite Gaming Platforms: PC
- Programming Language of Choice: Everything... and C#
- Location: dnXstudios
- Contact:
Re: CPU Usage
Ahhhhh ok makes sense. Thanks a lotdandymcgee wrote:As soon as you limit the frame rate you'll go from 100% CPU usage to 2% easy. The continuous loop is most certainly the cause.dnxviral wrote:I'm considerably worried about processing just because I'm not doing much with the game yet. Do you mean that cpu usage is noticeable at the beginnings of development? This doesn't seem logical...Ginto8 wrote:Once again, you're worrying too much about things. In a "minor" game, you will see low-to-mid range CPU usage when it is functioning normally. However, it will be easily visible when it isn't, because you will often see twice as much or more. How to fix an actual issue like that is just to debug your program and find where it goes into an uncontrolled infinite loop.
But as for infinite loops. I only have a continues loop in a thread for game mechanics and such, thread is also closed on exit.