Open
Bug 827428
Opened 13 years ago
Updated 3 years ago
Clicking "Show all downloads" can cause main-thread IO while loading icons
Categories
(Firefox :: Downloads Panel, defect)
Tracking
()
NEW
People
(Reporter: ted, Unassigned)
References
(Depends on 1 open bug)
Details
(Whiteboard: [Snappy][sps])
I noticed that clicking "Show all Downloads" on my Windows Nightly hangs my browser for several seconds. Here's a profile:
http://people.mozilla.com/~bgirard/cleopatra/#report=9521fcdcca20db06eaad44eda0a179e9b472ee4b
You can see the giant red area on the right where the UI is hung. Looking at the profile, this appears to be mostly under nsIconChannel::GetHIconFromFile. My downloads are on a network share, so presumably we're loading icons from all my downloaded files over the network synchronously on the UI thread. :-/
Comment 1•13 years ago
|
||
Hmm, ShGetFileInfo doesn't have an async version AFAIK <http://mxr.mozilla.org/mozilla-central/source/image/decoders/icon/win/nsIconChannel.cpp#335>, but perhaps we can avoid trying to show all the icons in one shot?
Reporter | ||
Comment 3•13 years ago
|
||
This could get morphed into an imglib bug. It looks like the reason this sucks so much is that nsIconChannel (on Windows) does all the work of looking up the file icon directly from its AsyncOpen method, and these calls can block quite a bit. If it did the hard work on a background thread this would probably work fine.
Comment 4•13 years ago
|
||
(In reply to Ted Mielczarek [:ted.mielczarek] from comment #3)
> This could get morphed into an imglib bug.
I'd prefer if this would depend on an imglib bug, since regardless what we do in platform we need a fix in Aurora and ensure what we have doesn't suck too much.
Reporter | ||
Comment 5•13 years ago
|
||
If you look at the profile, you can see that about 51% of the time is under GetSpecialFolderIcon, 35% under SHGetFileInfoW, and 11% under nsLocalFile::Exists.
Updated•13 years ago
|
Whiteboard: [Snappy][sps]
Comment 6•13 years ago
|
||
The current code in Inbound (bug 827405) should limit the icons loading to the visible items, it's still bad main-thread but quite limited on opening the view. Let us know when you have a chance to test that.
Comment 7•13 years ago
|
||
Regardless, loading an icon from the network can take a while due to network problems even for a single item.
I wonder if we could identify the network case, and in that situation use the "generic" icon for the file extension, provided by the OS (e.g. moz-icon://.png)
Comment 8•13 years ago
|
||
no more blocking the hang bug due to the new lazy behavior and I don't think we can fix platform in time, this remains open as future improvement but won't block the feature.
No longer blocks: 827245
Updated•13 years ago
|
Summary: Clicking "Show all downloads" can cause UI to hang while loading icons → Clicking "Show all downloads" can cause main-thread IO while loading icons
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•