Java: Netbeans debugging session works faster than normal run

Posted by Martijn Courteaux on Stack Overflow See other posts from Stack Overflow or by Martijn Courteaux
Published on 2009-09-09T10:45:29Z Indexed on 2010/06/11 20:13 UTC
Read the original article Hit count: 314

Hello,

I'm making Braid in Netbeans 6.7.1.

Computer Spec:

Windows 7
Running processes: 46
Running threads: +/- 650
NVidia GeForce 9200M GS
Intel Core 2 Duo CPU P8400 @ 2.26Ghz


Game-spec with normal run:

Memory: between 80 MB and 110 MB
CPU: between 9% and 20%
CPU when time rewinding: 90%

The same values for the debugging session, except when I rewind the time: CPU: 20%.

Is there any reason for? Is there a way to reach the same performance with a normal run.

This is my repaint code:

 @Override
 public void repaint()
 {
     BufferStrategy bs = getBufferStrategy(); // numBuffers: 4
     Graphics g = bs.getDrawGraphics();
     g.setColor(Color.BLACK);
     g.fillRect(-1, -1, 2000, 2000);
     gamePanel.paint(g.create(x, y, gameDim.width, gameDim.height));
     bs.show();
     g.dispose();
     Toolkit.getDefaultToolkit().sync();
     update(g);
 }

The game runs in fullscreen (undecorated + frame.size = screensize)

Martijn

© Stack Overflow or respective owner

Related posts about java

Related posts about debugging