我想弄清楚在渲染简单方块时openGL(LWJGL)和swing之间有什么区别.不出所料,openGL赢了,但在某些测试中,结果很接近,甚至有利于摆动.为什么会这样?
我的测试结果:
Testing for a total of 500000 rectangles
Swing time: 0.16367821
OpenGL time: 0.06317429
OpenGL relative to SWING is faster by 159.0899%
Testing for a total of 750000 rectangles
OpenGL time: 0.066062525
Swing time: 0.16988374
OpenGL relative to SWING is faster by 157.156%
Testing for a total of 1000000 rectangles
OpenGL time: 0.0907693
Swing time: 0.15694521
OpenGL relative to SWING is faster by 72.90561%
Testing for a total of 1250000 rectangles
OpenGL time: 0.09591239
Swing time: 0.17011923
OpenGL relative …Run Code Online (Sandbox Code Playgroud)