Closed
Bug 890618
Opened 12 years ago
Closed 11 years ago
FaviconHelper::GetOutputIconPath causes main thread jank
Categories
(Core :: Widget: Win32, defect)
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)
1.92 KB,
patch
|
bbondy
:
review+
|
Details | Diff | Splinter Review |
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++
Comment 1•12 years ago
|
||
I think we can move the directory create inside AsyncEncodeAndWriteIcon::Run()
Updated•12 years ago
|
Assignee: nobody → netzen
Comment 2•12 years ago
|
||
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++]
Comment 3•12 years ago
|
||
(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?
Updated•12 years ago
|
Assignee: nobody → akhetarp
Comment 4•12 years ago
|
||
(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.
![]() |
Reporter | |
Comment 5•11 years ago
|
||
Any updates here?
Comment 6•11 years ago
|
||
Resetting back for someone to take it, I haven't heard back. I'll reach out to a contributor.
Assignee: akhetarp → nobody
Updated•11 years ago
|
Assignee: nobody → anujagarwal464
Comment 7•11 years ago
|
||
This is the create directory call:
http://dxr.mozilla.org/mozilla-central/source/widget/windows/WinUtils.cpp#1070
We want to instead put the call in this function:
http://dxr.mozilla.org/mozilla-central/source/widget/windows/WinUtils.cpp#797
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #8389324 -
Flags: feedback?(netzen)
Comment 9•11 years ago
|
||
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+
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #8389345 -
Flags: review?(netzen)
Comment 11•11 years ago
|
||
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+
Updated•11 years ago
|
Attachment #8389324 -
Attachment is obsolete: true
Comment 12•11 years ago
|
||
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
![]() |
Reporter | |
Comment 13•11 years ago
|
||
I checked the patch too, looks pretty good to me. Thanks!
Assignee | ||
Comment 14•11 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #13)
> I checked the patch too, looks pretty good to me. Thanks!
:D :D
Assignee | ||
Comment 15•11 years ago
|
||
(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.
Comment 16•11 years ago
|
||
Probably just an intermittent failure unrelated to this. I'll keep an eye on it.
Comment 17•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Updated•11 years ago
|
status-firefox31:
--- → fixed
Comment 19•11 years ago
|
||
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)
Comment 20•11 years ago
|
||
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.
Comment 21•11 years ago
|
||
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.
You need to log in
before you can comment on or make changes to this bug.
Description
•