DBus menu is very slow when using large menu
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| DBus Menu |
Fix Released
|
Medium
|
Ted Gould | |
| libdbusmenu (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
Chrome tries to expose the user's bookmarks via GTK. We found that our app startup could take multiple minutes (!) for users that had a lot of bookmarks.
http://
http://
Some more technical details: because we have a weird custom menu, what we do is build a hidden GtkMenu that we insert all of our bookmarks in. The call stack when the code is hung looks like this:
Thread 1 (Thread 0xb62bb870 (LWP 31589)):
#0 0xb6f5307e in ?? () from /usr/lib/
#1 0xb6f4fb53 in g_value_init () from /usr/lib/
#2 0xaf66d70e in dbusmenu_
#3 0xaf66d9c6 in ?? () from /usr/lib/
#4 0xb6e7a1a9 in g_list_foreach () from /lib/i386-
#5 0xaf66d9e9 in ?? () from /usr/lib/
#6 0xb6e7a1a9 in g_list_foreach () from /lib/i386-
#7 0xaf66d9e9 in ?? () from /usr/lib/
#8 0xb6e7a1a9 in g_list_foreach () from /lib/i386-
#9 0xaf66d9e9 in ?? () from /usr/lib/
#10 0xb6e7a1a9 in g_list_foreach () from /lib/i386-
#11 0xaf66d9e9 in ?? () from /usr/lib/
#12 0xb6e7a1a9 in g_list_foreach () from /lib/i386-
#13 0xaf66d9e9 in ?? () from /usr/lib/
#14 0xaf66f901 in dbusmenu_
#15 0xaf67241b in ?? () from /usr/lib/
#16 0xaf672e3d in ?? () from /usr/lib/
#17 0xb66c85b2 in ?? () from /usr/lib/
#18 0xb6e7a311 in ?? () from /lib/i386-
#19 0xb6e7eaa8 in g_main_
#20 0xb6e7f270 in ?? () from /lib/i386-
#21 0xb6e7f524 in g_main_
#22 0x0879f259 in base::MessagePu
We're going to disable this code for now. We'll put the bookmarks menu code behind a flag, so that you can test any fixes to this bug against trunk Chrome by running with that flag, and once this code is performant we'll reenable it. In general, it's really bad for startup performance to put this in the critical path of startup; it'd be nice if we could do this on a background thread.
Related branches
- Charles Kerr (community): Approve on 2012-03-28
-
Diff: 167 lines (+55/-7)1 file modifiedlibdbusmenu-glib/server.c (+55/-7)
- Ken VanDine: Pending requested 2012-06-13
-
Diff: 11864 lines (+11365/-22)62 files modifiedChangeLog (+32/-0)
configure (+11/-11)
configure.ac (+3/-3)
debian/changelog (+10/-0)
docs/libdbusmenu-glib/reference/html/annotation-glossary.html (+83/-0)
docs/libdbusmenu-glib/reference/html/api-index-deprecated.html (+31/-0)
docs/libdbusmenu-glib/reference/html/api-index-full.html (+593/-0)
docs/libdbusmenu-glib/reference/html/ch01.html (+50/-0)
docs/libdbusmenu-glib/reference/html/index.html (+49/-0)
docs/libdbusmenu-glib/reference/html/index.sgml (+176/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuClient.html (+607/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitem.html (+1893/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuMenuitemProxy.html (+166/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-DbusmenuServer.html (+412/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib-Types.html (+276/-0)
docs/libdbusmenu-glib/reference/html/libdbusmenu-glib.devhelp2 (+161/-0)
docs/libdbusmenu-glib/reference/html/object-tree.html (+32/-0)
docs/libdbusmenu-glib/reference/html/style.css (+266/-0)
docs/libdbusmenu-glib/reference/tmpl/client.sgml (+228/-0)
docs/libdbusmenu-glib/reference/tmpl/menuitem-proxy.sgml (+59/-0)
docs/libdbusmenu-glib/reference/tmpl/menuitem.sgml (+721/-0)
docs/libdbusmenu-glib/reference/tmpl/server.sgml (+171/-0)
docs/libdbusmenu-glib/reference/tmpl/types.sgml (+109/-0)
docs/libdbusmenu-glib/reference/version.xml (+1/-1)
docs/libdbusmenu-glib/reference/xml/annotation-glossary.xml (+80/-0)
docs/libdbusmenu-glib/reference/xml/api-index-deprecated.xml (+8/-0)
docs/libdbusmenu-glib/reference/xml/api-index-full.xml (+153/-0)
docs/libdbusmenu-glib/reference/xml/client.xml (+448/-0)
docs/libdbusmenu-glib/reference/xml/menuitem-proxy.xml (+114/-0)
docs/libdbusmenu-glib/reference/xml/menuitem.xml (+1331/-0)
docs/libdbusmenu-glib/reference/xml/server.xml (+309/-0)
docs/libdbusmenu-glib/reference/xml/types.xml (+192/-0)
docs/libdbusmenu-gtk/reference/html/annotation-glossary.html (+47/-0)
docs/libdbusmenu-gtk/reference/html/api-index-deprecated.html (+31/-0)
docs/libdbusmenu-gtk/reference/html/api-index-full.html (+119/-0)
docs/libdbusmenu-gtk/reference/html/ch01.html (+45/-0)
docs/libdbusmenu-gtk/reference/html/index.html (+44/-0)
docs/libdbusmenu-gtk/reference/html/index.sgml (+43/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-DbusmenuGtkClient.html (+347/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-DbusmenuGtkMenu.html (+187/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-menuitem.html (+274/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk-parser.html (+118/-0)
docs/libdbusmenu-gtk/reference/html/libdbusmenu-gtk.devhelp2 (+38/-0)
docs/libdbusmenu-gtk/reference/html/object-tree.html (+32/-0)
docs/libdbusmenu-gtk/reference/html/style.css (+266/-0)
docs/libdbusmenu-gtk/reference/tmpl/client.sgml (+110/-0)
docs/libdbusmenu-gtk/reference/tmpl/menu.sgml (+56/-0)
docs/libdbusmenu-gtk/reference/tmpl/menuitem.sgml (+86/-0)
docs/libdbusmenu-gtk/reference/tmpl/parser.sgml (+42/-0)
docs/libdbusmenu-gtk/reference/version.xml (+1/-1)
docs/libdbusmenu-gtk/reference/xml/annotation-glossary.xml (+32/-0)
docs/libdbusmenu-gtk/reference/xml/api-index-deprecated.xml (+8/-0)
docs/libdbusmenu-gtk/reference/xml/api-index-full.xml (+32/-0)
docs/libdbusmenu-gtk/reference/xml/client.xml (+238/-0)
docs/libdbusmenu-gtk/reference/xml/menu.xml (+133/-0)
docs/libdbusmenu-gtk/reference/xml/menuitem.xml (+178/-0)
docs/libdbusmenu-gtk/reference/xml/parser.xml (+77/-0)
libdbusmenu-glib/enum-types.h (+1/-1)
libdbusmenu-glib/enum-types.h.in (+1/-1)
libdbusmenu-gtk/genericmenuitem-enum-types.h (+1/-1)
libdbusmenu-gtk/genericmenuitem-enum-types.h.in (+1/-1)
libdbusmenu-gtk/genericmenuitem.c (+2/-2)
Changed in dbusmenu: | |
status: | New → Triaged |
importance: | Undecided → Medium |
assignee: | nobody → Ted Gould (ted) |
Elliot Glaysher (glaysher) wrote : | #1 |
Ajay Roopakalu (ajay-roopakalu) wrote : | #2 |
My Chrome is affected by this bug.
I ran dbusmenu-dumper on the hanging Chrome process (I don't want to attach the file for privacy reasons since all my bookmarks are listed) and it outputted a file that was over 65k lines of JSON.
Ted Gould (ted) wrote : | #3 |
Could you please attach a JSON dump of the menus that cause this bug? It would help greatly with debugging it. To do that you'll need to install libdbusmenu-tools package and run /usr/lib/
Elliot Glaysher (glaysher) wrote : | #4 |
In chrome, we're fixing this by removing all icons from the History menu and the Bookmarks menu in its entirety. (This doesn't mean we're abandoning the rest of the global menu.)
In general, I mirror Evan's comment that it'd be nice if this wasn't in the critical path.
Chris Coulson (chrisccoulson) wrote : | #5 |
This hits Firefox really hard as well now in Precise, now that the HUD is asking for the whole menu structure at once. I did a rough test, and it takes roughly a minute of CPU for 8000 bookmarks (arranged 20*20*20)
On Tue, 2012-03-27 at 01:37 +0000, Chris Coulson wrote:
> This hits Firefox really hard as well now in Precise, now that the HUD
> is asking for the whole menu structure at once. I did a rough test, and
> it takes roughly a minute of CPU for 8000 bookmarks (arranged 20*20*20)
Can you attach a dbus-menu-dumper output of that to the bug? That way
we can use it for a test.
Chris Coulson (chrisccoulson) wrote : | #7 |
Here we go - it's quite big! This contains around 8000 bookmarks or so
Charles Kerr (charlesk) wrote : | #8 |
Chris' awesome hash cache patch has landed and will be in this week's release.
Chris Coulson (chrisccoulson) wrote : | #9 |
This is in precise now
Changed in libdbusmenu (Ubuntu): | |
status: | New → Fix Released |
Chris Coulson (chrisccoulson) wrote : | #10 |
Evan / Elliot - is there still a flag for enabling the bookmark menu in Chrome?
Changed in dbusmenu: | |
status: | Triaged → Fix Committed |
Greg A (etulfetulf) wrote : | #11 |
The code has been removed from Chrome: http://
Changed in dbusmenu: | |
status: | Fix Committed → Fix Released |
It seems to be still here in Ubuntu 12.10, or am I wrong?
I don't have a Natty install at the moment, but I'll point out that depending on disk contention, the bookmark menu code can potentially send two 16x16 icons for each bookmark menu item (set default favicon since favicon database hasn't async loaded yet, set the real favicon after database).
So for 100 bookmarks * 16x16 icon * 4 bytes a pixel is 800kb for one pass, 1.5 megs for both passes. Is that a problem for dbus?