jmonkeyengine icon indicating copy to clipboard operation
jmonkeyengine copied to clipboard

Improved performance in the lwjgx backend (AWT and OpenGL)

Open JNightRider opened this issue 1 month ago • 0 comments

Hello everyone, after a long time, I finally have some free time so I started working on the performance problem that lwjglx has when supporting OpenGL with AWT.

  • In Linux, if the CPU doesn't have time to breathe, the context starts to fail. If this time is too long, it creates a bottleneck by causing a drop in FPS, which severely impacts performance.
  • In Windows, if there is a pause to allow the CPU to breathe, the same synchronization problem arises because there are drastic drops in FPS; by removing that pause, things return to normal and the context problem is no longer present.
  • Regarding macOS, I cannot comment since I do not have the equipment to perform performance tests, so it should continue to work the same way (works fine).

[ Screenshots ]

Linux

Before

With a maximum of 85 pfs, in theory it should reach the 144 pfs that this machine supports.

Captura desde 2025-12-13 14-35-03

After

Then with the applied changes it can reach 145, (which is the maximum that this machine offers, so a high-end model should work as in a normal context without AWT)

Captura desde 2025-12-13 14-33-03

Windows

Before

~ 60 fps

Captura de pantalla 2025-12-13 160112

After

~140 fps Captura de pantalla 2025-12-13 160648

JNightRider avatar Dec 13 '25 23:12 JNightRider