I know being superstitious isnt what a programmer should be, but im a little that way when it comes to really strange bugs.At the moment, my application suddenly stopped cycling quickly and started going with a really poor framerate... All I do is uncommentthis for loop and then all of sudden it starts going really slow.

all tiles have 0 astones so it shouldnt even be accessing the loops even though it somehow is, and the simple commented out for loop iteratingthe v variable is enough to make it go slow for no reason.I thought maybe it was because I had too much stuff in a single file, so I broke the program up to another file but it didnt make a difference, forsome reason its going slow and I have NO IDEA WHY.

As soon as I comment out the for loop it decides to go quick, and note ITS NOT RENDERING ANYTHING.

Its not because im using too much ram, because I checked that... anyone can help me with this really strange problem, like, can anything else you know of could slow a program down for virtually no reason?

Ive in fact mucked around with it more, and I got it working from commenting out completely safe code thats not doing any work at all just returning false and not even chaining to it and it still triggers off the slowness!!! what could be the problem?!?!?

Keep in mind that the java compiler (sourcecode=>bytecode) is doing little to no optimization. Every optimization is performed at runtime. Just compare how long a C compiler can take to compile an entire project (minutes / hours) and how long it takes in Java (seconds, if that... Eclipse is continually compiling every character typed, making compilation time almost zero seconds).

Now in those few seconds the HotSpot JIT compiler is analyzing your code at runtime, it approaches (on average) 90% of the performance the best C compiler achieves.

Give that fact, it's understandable that the HotSpot JIT tends to give up earlier on 'too complex code', as it would make the application stutter.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

Despite of this more uncommon problem (most java devs have methods < 50 lines in 98% of the cases), you should make yourself familiar with a profiler. You get one for free build in, if you use Netbeans, which is more or less the same like Visual VM, that you can run standalone.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org