You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem is exacerbated by the fact that Skiko's default settings submit the next redraw request as soon as the old one finishes, so regardless of how fast drawing actually happens, swing's UI thread is constantly swamped with Skiko rendering:
Swing uses the UI thread for drawing its own UI and especially for handling input events. Skiko's behaviour of swamping the UI thread creates significant input event lag. Even though Skiko's rendering is faster than what I had before, the UI is much laggier because it takes a lot longer for the event thread to pick up the input events, so the program takes a long time to respond to input.
I would suggest the following fixes:
Don't request redraw immediately after rendering. Use a rate limiter or let the client program drive Skiko with its own event loop.
Perform rendering off the event thread, into a back buffer. This way, even if rendering is slow (which it sometimes is for large scenes and slow hardware), input is still handled quickly and the UI remains snappy.
The text was updated successfully, but these errors were encountered:
Also note that Skiko on different platforms and backends behaves differently, so it would be better to describe OS and drawing backend used.
olonho
changed the title
Performance characteristics of skiko are not good
Performance characteristics of skiko AWT on Linux + OpenGL are not good
Feb 14, 2022
General advice for dealing with Swing UI (and UI in general) is to render into a backbuffer, then swap the buffers.
Before I switched to Skiko, I drew into a java.awt.Canvas which I could swap:
http://www.cokeandcode.com/info/tut2d.html
However, Skiko draws and renders everything on the UI thread:
skiko/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
Line 419 in 8e84e9e
skiko/skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
Line 472 in 8e84e9e
skiko/skiko/src/awtMain/kotlin/org/jetbrains/skiko/redrawer/LinuxOpenGLRedrawer.kt
Line 80 in c8bdf96
This problem is exacerbated by the fact that Skiko's default settings submit the next redraw request as soon as the old one finishes, so regardless of how fast drawing actually happens, swing's UI thread is constantly swamped with Skiko rendering:
skiko/skiko/src/commonMain/kotlin/org/jetbrains/skiko/SkikoView.kt
Line 27 in 2d49c26
Swing uses the UI thread for drawing its own UI and especially for handling input events. Skiko's behaviour of swamping the UI thread creates significant input event lag. Even though Skiko's rendering is faster than what I had before, the UI is much laggier because it takes a lot longer for the event thread to pick up the input events, so the program takes a long time to respond to input.
I would suggest the following fixes:
The text was updated successfully, but these errors were encountered: