Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My framerate lastime exceeds 1000 now the highest is 15. I have thousands lines of code in one class(I was still fresh last time and did not think of putting it in another class) Is it the class that makes the game slower?

share|improve this question

closed as not a real question by Byte56, bummzack, Nicol Bolas, doppelgreener, David Gouveia Oct 6 '12 at 8:25

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This is impossible for anyone to answer with the information you've provided, the size of the class is irrelevant. What matters is the code being called. Have you read the FAQ yet? I've asked multiple times. – Byte56 Oct 6 '12 at 7:23
up vote 3 down vote accepted

How to identify the issue:

To find out what is slowing down your game (also known as bottleneck), you could use Profiling.

It is not classes that slow down frame rate, it is the amount of processing time it takes to complete the instructions in the code (for instance instructions that reside inside functions).

Using Profiling could help you check how much time is spent running each function and how many times each function is being ran.

Here are some suggestions on how to use Profiling with Java:

Then you would know for sure what is slowing the code down.

How to improve speed:

After you find the part of the code that is causing the slowdown, consider how to refactor the code. You may need to consult others or you might find out that you could use the resources in a new efficient way for the same result.

share|improve this answer
How do I fasten it up? – SystemNetworks Oct 6 '12 at 7:39
@SystemNetworks Remove the bottlenecks. There is no single answer for that. – doppelgreener Oct 6 '12 at 7:41
There is no 'magic answer' that will make code run faster. You simply identify the parts of the code that consumes the most processing time and think of ways to improve those parts for better efficiency. – zehelvion Oct 6 '12 at 7:47
@ArthurWulfWhite If you insist on answering questions that are off topic, you should at least make them community wiki. Answering questions that are off topic encourages users like SystemNetworks to continue to ask questions that are off topic, since they know they'll get an answer anyway. – Byte56 Oct 6 '12 at 14:59
@ArthurWulfWhite When you make your answer, check the community wiki check box in the bottom right. If we didn't ignore the off topic questions, people could ask whatever they wanted and get an answer. Just my thoughts. – Byte56 Oct 6 '12 at 15:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.