-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to improve JavaFX Clip performance #2
Comments
I looked at the initial test (without patch) and found the hotspot: createTexture/disposeTexture from clip's NGCanvas$RenderBuf.validate ():
The hotspot is GLContext.createFBO () called by ES2ResourceFactory.createRTTexture () so it means every clip is creating / disposing a texture without any caching (GC): that would be a great win to reuse a texture cache for the clip (its own resource ?) It confirms why your patch is faster: perform only 1 GLContext.createFBO () call instead of many ? Finally the hotspot concerns the clip handling (texture + GPU shader) and not the Marlin renderer having its own path clipper. |
I think there are two reasons why some JavaFX Clip processing is slow.
My patch avoids A's problem. B's problem hasn't been solved in my workaround. If A and B can be optimized, I think the FPS will be better than my workaround. |
I found out that the problem is in using
I opened a bug and can share the link when they give ID to it. |
With the following changes, the JavaFX clip benchmark fps is now
My macbook has improved to 28fps.
JavaFX's GraphicsContext implementation allocates a canvas-sized texture for each call to the clip method, making multiple calls costly. This can be confirmed with the following jvm option.
-Dprism.printallocs=true
It can be improved to a practical fps by performing clips all at once as follows.
In addition, specifying the following jvm option will increase by a few fps.
-Dprism.marlin.profile=speed
The text was updated successfully, but these errors were encountered: