After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 697274 - Unlock animation is unusably slow
Unlock animation is unusably slow
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: lock-screen
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 697633 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-04 14:34 UTC by Andreas Kloeckner
Modified: 2013-05-03 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Debian-generated software info (6.36 KB, text/plain)
2013-04-04 14:34 UTC, Andreas Kloeckner
  Details
st-theme-node-drawing: Depend less on the paint state in some helper functions (15.06 KB, patch)
2013-04-05 01:35 UTC, Jasper St. Pierre (not reading bugmail)
accepted-commit_now Details | Review
st-theme-node-drawing: Move most of the cached paint state to another struct (25.88 KB, patch)
2013-04-05 01:35 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st: Move the theme node drawing state to StWidget (20.13 KB, patch)
2013-04-05 01:35 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-theme-node: Move some allocation-independent textures back to the theme node (17.00 KB, patch)
2013-04-05 01:35 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-theme-node: Move some allocation-independent textures back to the theme node (20.71 KB, patch)
2013-04-05 02:49 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-widget: Cache two paint states (8.04 KB, patch)
2013-04-05 03:13 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-theme-node: Add a to_string function for debugging purposes (1.92 KB, patch)
2013-04-05 03:13 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-theme-node-drawing: Print a message on repaints for size changes (1.02 KB, patch)
2013-04-05 03:13 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
st-theme-node: Move some allocation-independent textures back to the theme node (20.77 KB, patch)
2013-04-05 04:41 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
st-theme-context: Disable interning of nodes for now (1.18 KB, patch)
2013-04-05 18:07 UTC, Jasper St. Pierre (not reading bugmail)
rejected Details | Review
screenshield: Remove box-shadow (893 bytes, patch)
2013-04-05 18:25 UTC, drago01
committed Details | Review
st-theme-node-drawing: Depend less on the paint state in some helper functions (15.06 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-theme-node-drawing: Move most of the cached paint state to another struct (25.88 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st: Move the theme node drawing state to StWidget (20.17 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-theme-node: Move some allocation-independent textures back to the theme node (20.77 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Revert "screenshield: Remove box-shadow" (764 bytes, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-widget: Cache two paint states (8.11 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
st-theme-node: Add a to_string function for debugging purposes (1.92 KB, patch)
2013-05-03 14:51 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Andreas Kloeckner 2013-04-04 14:34:05 UTC
Hi there,

on my Intel (Sandy Brige generation) i7, gnome-shell 3.8's unlock animation renders at about one frame every five seconds. It always makes me wonder whether the machine has crashed, or is about to. (3.6 was fine, at--I'd guess--tens of frames a second.)

If that matters, I am using a dual-screen setup with my laptop and a 1080p LCD side-by-side.

See the Debian bug template for software versions. The intel driver is at 2.20.14-1.

Andreas
Comment 1 Andreas Kloeckner 2013-04-04 14:34:56 UTC
Created attachment 240615 [details]
Debian-generated software info
Comment 2 Cosimo Cecchi 2013-04-04 14:40:58 UTC
I'm able to reproduce this as well, but only on dual head.
Comment 3 drago01 2013-04-04 19:20:09 UTC
<drago01> Jasper: seems to work much better with the patch from https://bugzilla.gnome.org/show_bug.cgi?id=689858
<Services> Bug 689858: normal, Normal, ---, gnome-shell-maint, UNCONFIRMED, St: optimize box-shadow rendering
<drago01> Jasper: seems like creating two box shadows for such large textures is a bit too much
<drago01> Jasper: we do spend 26% of the time in blur_pixels
Comment 4 drago01 2013-04-04 19:22:00 UTC
Some more notes:

1) This isn't SNB specific happens on ironlake and gm45 as well
2) Removing box shadow seems to fix it (hence why I tried with the optimize box shadow patch).
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-04-05 01:34:51 UTC
This is caused by the interning of theme nodes -- as theme nodes also
cache the paint state along with their last allocation, if two actors
have the same theme node but different sizes, they'll get in a battle
repainting and overwriting the last painted actor. A patch stack is
attached here to let individual widgets cache the paint state, but if
this is considered too intrusive for 3.8.1, we can simply turn off
theme node interning for the gnome-3-8 branch and put this on master.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-04-05 01:35:17 UTC
Created attachment 240677 [details] [review]
st-theme-node-drawing: Depend less on the paint state in some helper functions

We want to put the paint state in the actor rather than in the theme
node, as having two actors with different sizes but the same theme node
is now much less efficient.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-04-05 01:35:20 UTC
Created attachment 240678 [details] [review]
st-theme-node-drawing: Move most of the cached paint state to another struct

Since we now share theme nodes between, we shouldn't cache the paint state
across all nodes. As a first step towards putting this in the actor, split
out the state into another structure. Keep it in the theme node for now
so that we don't make too many changes in one commit.

It's possible that some of these pieces of drawing state could be shared
between theme nodes. For the sake of simplicity, assume that none of them
are shared or should be shared. A future commit could identify those that
could be shared and move them back into the theme node.
Comment 8 Jasper St. Pierre (not reading bugmail) 2013-04-05 01:35:24 UTC
Created attachment 240679 [details] [review]
st: Move the theme node drawing state to StWidget

This ensures that two widgets sharing the same theme node won't trample
on each other's prerendered materials if the actors are of different
sizes. This also tries to be very careful to share as much as possible
during a transition.

This has the side effect that if a widget changes state a bunch of times,
we won't cache every state. Since we expect that state changes are
infrequent and that most cases we'll be able to use the texture cache
to do most of the heavy lifting, this cost is much more insignificant
than rendering a number of different actors with the same theme node
and different sizes.
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-04-05 01:35:28 UTC
Created attachment 240680 [details] [review]
st-theme-node: Move some allocation-independent textures back to the theme node

The background image, background image shadow and border image are
allocation-indepedent, so we can keep these in the node. Given that these are
are likely cached in the StTextureCache, the slight increase in code complexity
may not be worth caching these textures and materials -- we might be better off
just computing when we need to paint.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-04-05 02:49:55 UTC
Created attachment 240683 [details] [review]
st-theme-node: Move some allocation-independent textures back to the theme node

The background image, background image shadow and border image are
allocation-indepedent, so we can keep these in the node. Given that these are
are likely cached in the StTextureCache, the slight increase in code complexity
may not be worth caching these textures and materials -- we might be better off
just computing when we need to paint.



Properly invalidate non-prerendered background / border images when
their file monitor fires.
Comment 11 Jasper St. Pierre (not reading bugmail) 2013-04-05 03:13:21 UTC
Created attachment 240684 [details] [review]
st-widget: Cache two paint states

In most cases, we'll transition between two states on hover / focus.
Instead of recalculating and repainting our resources on state change,
simply cache the last state when we transition.



This probably isn't worth the effort, but I wrote it just in case
somebody might want to investigate later. Also, it was fun.
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-04-05 03:13:35 UTC
Created attachment 240685 [details] [review]
st-theme-node: Add a to_string function for debugging purposes

Not crucial -- for debugging purposes.
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-04-05 03:13:45 UTC
Created attachment 240686 [details] [review]
st-theme-node-drawing: Print a message on repaints for size changes

For debugging purposes only.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-04-05 04:41:08 UTC
Created attachment 240690 [details] [review]
st-theme-node: Move some allocation-independent textures back to the theme node

The background image, background image shadow and border image are
allocation-indepedent, so we can keep these in the node. Given that these are
are likely cached in the StTextureCache, the slight increase in code complexity
may not be worth caching these textures and materials -- we might be better off
just computing when we need to paint.



Fix prerendered nodes with background images, like the avatar widget in the user menu.
Comment 15 Jasper St. Pierre (not reading bugmail) 2013-04-05 18:07:37 UTC
Created attachment 240782 [details] [review]
st-theme-context: Disable interning of nodes for now

An alternate patch for the GNOME 3.8.1 release if we consider the above patch stack to be too invasive.
Comment 16 Florian Müllner 2013-04-05 18:09:21 UTC
(In reply to comment #15)
> An alternate patch for the GNOME 3.8.1 release if we consider the above patch
> stack to be too invasive.

The least intrusive change IMHO would be to disable the box-shadow in question.
Comment 17 drago01 2013-04-05 18:23:17 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > An alternate patch for the GNOME 3.8.1 release if we consider the above patch
> > stack to be too invasive.
> 
> The least intrusive change IMHO would be to disable the box-shadow in question.

Yeah it is not *that* noticeable anyway. We should fix it properly for 3.10 (the patches from here + optimization patch).
Comment 18 drago01 2013-04-05 18:25:14 UTC
Created attachment 240783 [details] [review]
screenshield: Remove box-shadow

This causes very low performance in some situations (like multiscreen). Proper
fixes are too invasive at this point (3.8.1) so lets just remove the shadow
for now and add it back later once he have fixed it.
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-04-07 18:25:31 UTC
Review of attachment 240783 [details] [review]:

Let's go with this for now.
Comment 20 Jasper St. Pierre (not reading bugmail) 2013-04-07 18:44:53 UTC
Review of attachment 240782 [details] [review]:

Nope
Comment 21 drago01 2013-04-07 20:07:48 UTC
Comment on attachment 240783 [details] [review]
screenshield: Remove box-shadow

Attachment 240783 [details] pushed as 98e74df - screenshield: Remove box-shadow
Comment 22 drago01 2013-04-09 13:07:26 UTC
*** Bug 697633 has been marked as a duplicate of this bug. ***
Comment 23 drago01 2013-05-03 12:08:44 UTC
Review of attachment 240677 [details] [review]:

OK.
Comment 24 drago01 2013-05-03 12:15:37 UTC
Can you rebase the others?
Comment 25 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:15 UTC
Created attachment 243191 [details] [review]
st-theme-node-drawing: Depend less on the paint state in some helper functions

We want to put the paint state in the actor rather than in the theme
node, as having two actors with different sizes but the same theme node
is now much less efficient.
Comment 26 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:18 UTC
Created attachment 243192 [details] [review]
st-theme-node-drawing: Move most of the cached paint state to another struct

Since we now share theme nodes between, we shouldn't cache the paint state
across all nodes. As a first step towards putting this in the actor, split
out the state into another structure. Keep it in the theme node for now
so that we don't make too many changes in one commit.

It's possible that some of these pieces of drawing state could be shared
between theme nodes. For the sake of simplicity, assume that none of them
are shared or should be shared. A future commit could identify those that
could be shared and move them back into the theme node.
Comment 27 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:22 UTC
Created attachment 243193 [details] [review]
st: Move the theme node drawing state to StWidget

This ensures that two widgets sharing the same theme node won't trample
on each other's prerendered materials if the actors are of different
sizes. This also tries to be very careful to share as much as possible
during a transition.

This has the side effect that if a widget changes state a bunch of times,
we won't cache every state. Since we expect that state changes are
infrequent and that most cases we'll be able to use the texture cache
to do most of the heavy lifting, this cost is much more insignificant
than rendering a number of different actors with the same theme node
and different sizes.
Comment 28 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:26 UTC
Created attachment 243194 [details] [review]
st-theme-node: Move some allocation-independent textures back to the theme node

The background image, background image shadow and border image are
allocation-indepedent, so we can keep these in the node. Given that these are
are likely cached in the StTextureCache, the slight increase in code complexity
may not be worth caching these textures and materials -- we might be better off
just computing when we need to paint.
Comment 29 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:30 UTC
Created attachment 243195 [details] [review]
Revert "screenshield: Remove box-shadow"

This reverts commit 98e74dfd38bd44154e002000ed46be4ed622173d.
Comment 30 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:34 UTC
Created attachment 243196 [details] [review]
st-widget: Cache two paint states

In most cases, we'll transition between two states on hover / focus.
Instead of recalculating and repainting our resources on state change,
simply cache the last state when we transition.
Comment 31 Jasper St. Pierre (not reading bugmail) 2013-05-03 14:51:38 UTC
Created attachment 243197 [details] [review]
st-theme-node: Add a to_string function for debugging purposes
Comment 32 drago01 2013-05-03 15:27:47 UTC
Review of attachment 240686 [details] [review]:

No.
Comment 33 drago01 2013-05-03 18:37:31 UTC
Review of attachment 243191 [details] [review]:

OK.
Comment 34 drago01 2013-05-03 18:38:28 UTC
Review of attachment 243192 [details] [review]:

LG.
Comment 35 drago01 2013-05-03 18:40:18 UTC
Review of attachment 243193 [details] [review]:

LG.
Comment 36 drago01 2013-05-03 18:41:51 UTC
Review of attachment 243194 [details] [review]:

Makes sense, code looks good.
Comment 37 drago01 2013-05-03 18:42:39 UTC
Review of attachment 243195 [details] [review]:

Performance is indeed restored with this patches so we can add the shadow back.
Comment 38 drago01 2013-05-03 18:45:23 UTC
Review of attachment 243196 [details] [review]:

::: src/st/st-widget.c
@@ +273,3 @@
 }
 
+static inline void

Just trust the compiler unless you have a reason to think that it will get it wrong.

@@ +279,3 @@
+}
+
+static inline StThemeNodePaintState *

Same here.
Comment 39 drago01 2013-05-03 18:46:16 UTC
Review of attachment 243197 [details] [review]:

OK.
Comment 40 Jasper St. Pierre (not reading bugmail) 2013-05-03 19:56:45 UTC
Attachment 243191 [details] pushed as 40b895d - st-theme-node-drawing: Depend less on the paint state in some helper functions
Attachment 243192 [details] pushed as 72bc46d - st-theme-node-drawing: Move most of the cached paint state to another struct
Attachment 243193 [details] pushed as 49064ed - st: Move the theme node drawing state to StWidget
Attachment 243194 [details] pushed as c29aaa0 - st-theme-node: Move some allocation-independent textures back to the theme node
Attachment 243195 [details] pushed as db14dc9 - Revert "screenshield: Remove box-shadow"
Attachment 243196 [details] pushed as a2fcbb7 - st-widget: Cache two paint states
Attachment 243197 [details] pushed as 53c609c - st-theme-node: Add a to_string function for debugging purposes


Pushed with suggested changes.