dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Weird performance

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    175

    [F8] Weird performance

    Hi,

    I'm having a strange sort of performance problem with my game where it works fine for about 15-30 seconds, then my CPU fan kicks on and a few seconds later the performance suddenly degrades. I have it set up to run a level that loops the same pattern of objects in a tight interval, so there is nearly the same count of objects on screen in the same positions throughout the run. I did some timing experiments with getTimer() and found that while there is no single bottleneck, everything takes approximately twice as long. In fact, I added a dummy loop that increments a variable 10,000 times each frame, and found that it takes about 7ms before the slowdown.

    My only guess as to what would cause this type of slowdown is if the garbage collector were really working hard (I'm looking now for objects that I turn over too quickly), but I was wondering if anyone else had seen this type of behavior before. It could be that I just coded something poorly, but the fact that it's an instant change instead of a gradual one, and that even a dummy loop was affected in the same proportion as the rest of my script, suggests to me that that there's some internal mechanism that I'm upsetting.

  2. #2
    Senior Member
    Join Date
    Apr 2001
    Posts
    175
    Oh, I didn't finish the last sentence in my first paragraph, what I meant to say was that the dummy loop takes 7 ms before the slowdown and 15 ms afterwards, which is interesting to me because it suggests that the slowdown isn't caused by the rest of my code having a larger workload (ie. because I forgot to remove some objects from update lists), but that there's a general slowdown in code execution. That's what lead me to think it might be the garbage collector (maybe they run it in a different thread, so its execution is interleaved with the script interpretation) or some other internal mechanism eating up lots of time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center