Closed Bug 890618 Opened 12 years ago Closed 11 years ago

FaviconHelper::GetOutputIconPath causes main thread jank

Categories

(Core :: Widget: Win32, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla31
Tracking Status
firefox31 --- verified

People

(Reporter: mayhemer, Assigned: anujagarwal464)

Details

(Keywords: perf, Whiteboard: [mentor=bbondy][lang=c++])

Attachments

(1 file, 1 obsolete file)

ntdll.dll!_NtQueryFullAttributesFile@8() + 0x12 bytes ntdll.dll!_NtQueryFullAttributesFile@8() + 0x12 bytes xul.dll!nsAString_internal::SetCapacity(unsigned int capacity=0, const mozilla::fallible_t & __formal={...}) Line 546 C++ xul.dll!GetFileInfo(const nsString & name={...}, PRFileInfo64 * info=0x00000000) Line 690 + 0xe bytes C++ xul.dll!nsLocalFile::ResolveAndStat() Line 1048 + 0xc bytes C++ xul.dll!nsLocalFile::Create(unsigned int type=1, unsigned int attributes=511) Line 1232 C++ > xul.dll!mozilla::widget::FaviconHelper::GetOutputIconPath(nsCOMPtr<nsIURI> aFaviconPageURI={...}, nsCOMPtr<nsIFile> & aICOFile={...}, bool aURLShortcut=false) Line 917 + 0xf bytes C++ xul.dll!mozilla::widget::FaviconHelper::ObtainCachedIconFile(nsCOMPtr<nsIURI> aFaviconPageURI={...}, nsString & aICOFilePath={...}, nsCOMPtr<nsIThread> & aIOThread={...}, bool aURLShortcut=false) Line 819 + 0x26 bytes C++ xul.dll!mozilla::widget::JumpListShortcut::GetShellLink(nsCOMPtr<nsIJumpListItem> & item={...}, nsRefPtr<IShellLinkW> & aShellLink={...}, nsCOMPtr<nsIThread> & aIOThread={...}) Line 410 + 0x44 bytes C++ xul.dll!mozilla::widget::JumpListBuilder::AddListToBuild(short aCatType=3, nsIArray * items=0x105925f0, const nsAString_internal & catName={...}, bool * _retval=0x004ee388) Line 361 + 0x17 bytes C++
I think we can move the directory create inside AsyncEncodeAndWriteIcon::Run()
Assignee: nobody → netzen
Hi Even, would you be interested in helping with this bug? We want the directory creation calls shown in the call stack of Comment 0 out of the main thread and instead in the thread. See WinUtils.cpp This line needs to be moved out of GetOutputIconPath and called later: http://dxr.mozilla.org/mozilla-central/source/widget/windows/WinUtils.cpp#l981
Assignee: netzen → nobody
Whiteboard: [mentor=bbondy][lang=c++]
(In reply to Brian R. Bondy [:bbondy] from comment #2) > Hi Even, would you be interested in helping with this bug? > We want the directory creation calls shown in the call stack of Comment 0 > out of the main thread and instead in the thread. See WinUtils.cpp > > This line needs to be moved out of GetOutputIconPath and called later: > http://dxr.mozilla.org/mozilla-central/source/widget/windows/WinUtils. > cpp#l981 Hi Brian: I would love to help out with this bug, are you up for mentoring?
Assignee: nobody → akhetarp
(In reply to akhetarp from comment #3) > (In reply to Brian R. Bondy [:bbondy] from comment #2) > > Hi Even, would you be interested in helping with this bug? > > We want the directory creation calls shown in the call stack of Comment 0 > > out of the main thread and instead in the thread. See WinUtils.cpp > > > > This line needs to be moved out of GetOutputIconPath and called later: > > http://dxr.mozilla.org/mozilla-central/source/widget/windows/WinUtils. > > cpp#l981 > > Hi Brian: > > I would love to help out with this bug, are you up for mentoring? Awesome! Absolutely. Have you built the source code yet? If so See Comment 2 for a hint on where to start work on the problem. I'm off this week by the way, so I may be a bit slow to respond and not on IRC. But just ask questions here and I'll help out. Or you can email me if you prefer netzen@gmail.com.
Any updates here?
Resetting back for someone to take it, I haven't heard back. I'll reach out to a contributor.
Assignee: akhetarp → nobody
Assignee: nobody → anujagarwal464
Attachment #8389324 - Flags: feedback?(netzen)
Comment on attachment 8389324 [details] [diff] [review] create directory removed from main thread Review of attachment 8389324 [details] [diff] [review]: ----------------------------------------------------------------- One small change but this looks good, put the next patch for review and I'll do some testing locally and if that passes then I'll r+ the patch! Nice work! ::: widget/windows/WinUtils.cpp @@ +837,5 @@ > NS_ENSURE_TRUE(icoFile, NS_ERROR_FAILURE); > rv = icoFile->InitWithPath(mIconPath); > > + // Try to create the directory if it's not there yet > + nsCOMPtr<nsIFile> aICOFile; The a prefix on aICOFile is normally only used for function parameters. Let's call this: nsCOMPtr<nsIFile> dirPath;
Attachment #8389324 - Flags: feedback?(netzen) → feedback+
Comment on attachment 8389345 [details] [diff] [review] create directory removed from main thread - updated directory name Review of attachment 8389345 [details] [diff] [review]: ----------------------------------------------------------------- I tried this locally and it's working fine. I also put a breakpoint on the new code and confirmed it's off the main thread now. Nice work :)
Attachment #8389345 - Flags: review?(netzen) → review+
Attachment #8389324 - Attachment is obsolete: true
I pushed it to try, assuming all tests still pass I'll push it to mozilla-inbound next, then within a day it'll be on mozilla-central. https://tbpl.mozilla.org/?tree=Try&rev=30b6a1fca67d
I checked the patch too, looks pretty good to me. Thanks!
(In reply to Honza Bambas (:mayhemer) from comment #13) > I checked the patch too, looks pretty good to me. Thanks! :D :D
(In reply to Brian R. Bondy [:bbondy] from comment #12) > I pushed it to try, assuming all tests still pass I'll push it to > mozilla-inbound next, then within a day it'll be on mozilla-central. > https://tbpl.mozilla.org/?tree=Try&rev=30b6a1fca67d Build failed on Windows XP Opt.
Probably just an intermittent failure unrelated to this. I'll keep an eye on it.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Does this need manual QA verification ?
Flags: needinfo?(netzen)
Yes please, just make sure jump lists still work in the same way they did before. You may want to also uninstall and delete your profile before testing so you have to create the jump list folder which this code changes.
Flags: needinfo?(netzen)
31.0a2 (2014-05-08), 32.0a1 (2014-05-08) Win 7 x64 (In reply to Brian R. Bondy [:bbondy] from comment #19) > You may want to also uninstall and delete your profile before > testing so you have to create the jump list folder which this code changes. Exactly on the first run after doing this, the jump list won't show up. But this is not a regression of this bug, it's happening on a pre-fix build too. Restarting FF and opening again couple of tabs make the jump list to show up. On a regular browsing, the jump list is properly displayed/updated after ~ 2 min. I'm marking this bug as verified. If you think the above issue should be treated separately, please say and I'll file a new bug.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Yep that's fine, we don't try to generate the ICOs on startup on purpose because it would lead to a perf hit on startup.
See Also: → 1247843
See Also: 1247843
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: