Discussion:
DropShadow effect kills gfx responsiveness OS-wide
Mike Hearn
2018-11-04 19:17:20 UTC
Permalink
I'm on macOS High Sierra with a very new and very high end MacBook Pro.

I have a pretty basic GUI that uses translucency fairly aggressively. I
added a DropShadow effect to some nodes, which looks great, but to my great
surprise this one line of code kills the UI performance not of my app, but
other apps on the same machine, specifically:

- I can see the frame rate of the dock's zoom animation is lower
- Chrome becomes nearly unusable. Opening a new tab goes from nearly
instant to sluggish, this is very noticeable if you watch the tab in the
tab strip itself expand. It goes from smooth and fast to being able to see
the individual frames.

Stopping my app immediately restores the other apps to full framerate. So
presumably, the DropShadow shader is triggering some slow path not only in
JavaFX but the GPU or driver itself. I've experimenting with caching and
that speeds up scrolling of nodes with drop shadows in my own app, but the
OS-wide slowdown remains.

Has anyone seen anything like this before? I'm suspecting that I'll need to
render my own drop shadow effect using static bitmaps to work around it.

I don't have access to the OpenJDK bug tracker so I can't file a bug report
for this and I'm not sure how to reproduce it reliably. It's the first time
I noticed it.
Nir Lisker
2018-11-04 19:22:53 UTC
Permalink
Post by Mike Hearn
I don't have access to the OpenJDK bug tracker so I can't file a bug
report for this
You can do it at https://bugreport.java.com/bugreport/
Post by Mike Hearn
I'm on macOS High Sierra with a very new and very high end MacBook Pro.
I have a pretty basic GUI that uses translucency fairly aggressively. I
added a DropShadow effect to some nodes, which looks great, but to my great
surprise this one line of code kills the UI performance not of my app, but
- I can see the frame rate of the dock's zoom animation is lower
- Chrome becomes nearly unusable. Opening a new tab goes from nearly
instant to sluggish, this is very noticeable if you watch the tab in the
tab strip itself expand. It goes from smooth and fast to being able to see
the individual frames.
Stopping my app immediately restores the other apps to full framerate. So
presumably, the DropShadow shader is triggering some slow path not only in
JavaFX but the GPU or driver itself. I've experimenting with caching and
that speeds up scrolling of nodes with drop shadows in my own app, but the
OS-wide slowdown remains.
Has anyone seen anything like this before? I'm suspecting that I'll need to
render my own drop shadow effect using static bitmaps to work around it.
I don't have access to the OpenJDK bug tracker so I can't file a bug report
for this and I'm not sure how to reproduce it reliably. It's the first time
I noticed it.
Tom Schindl
2018-11-04 19:48:09 UTC
Permalink
I've never seen and don't see it slowing down other applications (I'm on
a MacBook Pro 13'') but I reported the DropShadow slow down and
documented the solution [1].

Tom

[1]
https://openjfx-dev.openjdk.java.narkive.com/I8NIK0db/bad-dropshadow-performance
Post by Nir Lisker
Post by Mike Hearn
I don't have access to the OpenJDK bug tracker so I can't file a bug
report for this
You can do it at https://bugreport.java.com/bugreport/
Post by Mike Hearn
I'm on macOS High Sierra with a very new and very high end MacBook Pro.
I have a pretty basic GUI that uses translucency fairly aggressively. I
added a DropShadow effect to some nodes, which looks great, but to my great
surprise this one line of code kills the UI performance not of my app, but
- I can see the frame rate of the dock's zoom animation is lower
- Chrome becomes nearly unusable. Opening a new tab goes from nearly
instant to sluggish, this is very noticeable if you watch the tab in the
tab strip itself expand. It goes from smooth and fast to being able to see
the individual frames.
Stopping my app immediately restores the other apps to full framerate. So
presumably, the DropShadow shader is triggering some slow path not only in
JavaFX but the GPU or driver itself. I've experimenting with caching and
that speeds up scrolling of nodes with drop shadows in my own app, but the
OS-wide slowdown remains.
Has anyone seen anything like this before? I'm suspecting that I'll need to
render my own drop shadow effect using static bitmaps to work around it.
I don't have access to the OpenJDK bug tracker so I can't file a bug report
for this and I'm not sure how to reproduce it reliably. It's the first time
I noticed it.
--
Tom Schindl, CTO
BestSolution.at EDV Systemhaus GmbH
Eduard-Bodem-Gasse 5-7. A-6020 Innsbruck
Reg. Nr. FN 222302s am Firmenbuchgericht Innsbruck
Loading...