Closed Bug 801509 Opened 7 years ago Closed 7 years ago

Tab sliding animation is janky

Categories

(Firefox :: General, defect)

defect
Not set

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: justin.lebar+bug, Unassigned)

Details

(Keywords: regression, Whiteboard: [snappy])

Attachments

(1 file)

Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/19.0 Firefox/19.0

Like bug 786397, but that seems to have fixed itself.

STR: Drag a tab around the tab bar.  It janks.

Profiling coming in a moment.
perf shows that we're spending a lot of time in malloc and free, which is interesting.  It seems to be coming from layout?  For example (sorry this is ugly):

>     1.25%  firefox  firefox                      [.] arena_run_tree_remove
>            |
>            --- arena_run_tree_remove
>               |          
>               |--94.12%-- arena_bin_nonfull_run_get
>               |          |          
>               |          |--92.97%-- malloc
>               |          |          |          
>               |          |          |--40.98%-- moz_xmalloc
>               |          |          |          |          
>               |          |          |          |--22.81%-- mozilla::FrameLayerBuilder::AddLayerDisplayItem(mozilla::layers::Layer*, nsDisplayItem*, mozilla::FrameLayerBuilder::Clip const&, mozilla::LayerState, nsPoint const&, mozilla::layers::LayerManager*, nsAutoPtr<nsDisplayItemGeometry>)
>               |          |          |          |          mozilla::FrameLayerBuilder::AddThebesDisplayItem(mozilla::layers::ThebesLayer*, nsDisplayItem*, mozilla::FrameLayerBuilder::Clip const&, nsIFrame*, mozilla::LayerState, nsPoint const&, nsAutoPtr<nsDisplayItemGeometry>)
>               |          |          |          |          _ZN7mozilla12_GLOBAL__N_114ContainerState19ProcessDisplayItemsERK13nsDisplayListRNS_17FrameLayerBuilder4ClipEj.clone.19
>               |          |          |          |          |          
>               |          |          |          |          |--78.07%-- _ZN7mozilla12_GLOBAL__N_114ContainerState19ProcessDisplayItemsERK13nsDisplayListRNS_17FrameLayerBuilder4ClipEj.clone.19
>               |          |          |          |          |          mozilla::FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder*, mozilla::layers::LayerManager*, nsIFrame*, nsDisplayItem*, nsDisplayList const&, mozilla::FrameLayerBuilder::ContainerParameters const&, gfx3DMatrix const*)
>               |          |          |          |          |          nsDisplayOwnLayer::BuildLayer(nsDisplayListBuilder*, mozilla::layers::LayerManager*, mozilla::FrameLayerBuilder::ContainerParameters const&)
>               |          |          |          |          |          _ZN7mozilla12_GLOBAL__N_114ContainerState19ProcessDisplayItemsERK13nsDisplayListRNS_17FrameLayerBuilder4ClipEj.clone.19
>               |          |          |          |          |          _ZN7mozilla12_GLOBAL__N_114ContainerState19ProcessDisplayItemsERK13nsDisplayListRNS_17FrameLayerBuilder4ClipEj.clone.19
>               |          |          |          |          |          _ZN7mozilla12_GLOBAL__N_114ContainerState19ProcessDisplayItemsERK13nsDisplayListRNS_17FrameLayerBuilder4ClipEj.clone.19
>               |          |          |          |          |          mozilla::FrameLayerBuilder::BuildContainerLayerFor(nsDisplayListBuilder*, mozilla::layers::LayerManager*, nsIFrame*, nsDisplayItem*, nsDisplayList const&, mozilla::FrameLayerBuilder::ContainerParameters const&, gfx3DMatrix const*)
>               |          |          |          |          |          nsDisplayList::PaintForFrame(nsDisplayListBuilder*, nsRenderingContext*, nsIFrame*, unsigned int) const
>               |          |          |          |          |          nsDisplayList::PaintRoot(nsDisplayListBuilder*, nsRenderingContext*, unsigned int) const
>               |          |          |          |          |          nsLayoutUtils::PaintFrame(nsRenderingContext*, nsIFrame*, nsRegion const&, unsigned int, unsigned int)
>               |          |          |          |          |          PresShell::Paint(nsIView*, nsRegion const&, nsIPresShell::PaintType, bool)
>               |          |          |          |          |          nsViewManager::ProcessPendingUpdatesForView(nsView*, bool)
>               |          |          |          |          |          nsViewManager::ProcessPendingUpdates()
>               |          |          |          |          |          nsRefreshDriver::Notify(nsITimer*)
>               |          |          |          |          |          nsTimerImpl::Fire()
>               |          |          |          |          |          nsTimerEvent::Run()
>               |          |          |          |          |          nsThread::ProcessNextEvent(bool, bool*)
Whiteboard: [snappy]
It's not all from layout; 50% of malloc calls are coming from g_malloc, which I can't see past in the stacktrace.

Here are the top few functions and abbreviated stack traces from perf.  I'll attach the full perf report in a moment, but it's not fun to read.  Note that all the arena_ functions are part of malloc or free.

>-   2.64%  firefox  firefox                      [.] free                                                   
>   - free                                                                                                   
>      + 14.30% _XReply                                                                                      
>      + 5.70% 0x7feb10f50f80                                                                                
>        4.86% gtk_main_do_event                                                                             
>      + 4.80% _cairo_user_data_array_fini                                                                   
>        4.72% 0x7feb0e1b2874                                                                                
>      + 3.77% nsTArray_base<nsTArrayDefaultAllocator>::ShrinkCapacity(unsigned int, unsigned long)          
>      + 3.43% PL_DHashTableRawRemove                                                                        
>      + 3.11% mozilla::FrameLayerBuilder::DisplayItemData::CopyInto(mozilla::FrameLayerBuilder::DisplayItemD
>      [many omitted]
>-   2.08%  firefox  libpthread-2.15.so           [.] pthread_mutex_lock                                     
>   - pthread_mutex_lock                                                                                     
>      - 26.66% moz_xmalloc                                                                                  
>         + 27.64% mozilla::FrameLayerBuilder::AddLayerDisplayItem(mozilla::layers::Layer*, nsDisplayItem*, m
>         + 11.34% XPCWrappedNative::GetNewOrUsed(XPCCallContext&, xpcObjectHelper&, XPCWrappedNativeScope*, 
>         + 10.08% NS_NewDOMNotifyPaintEvent(nsIDOMEvent**, nsPresContext*, nsEvent*, unsigned int, nsInvalid
>         + 9.46% gfxSurfaceDrawable::Draw(gfxContext*, gfxRect const&, bool, gfxPattern::GraphicsFilter cons
>         + 9.27% nsRunnableMethodTraits<void (nsPresContext::*)(), true>::base_type* NS_NewRunnableMethod<ns
>         + 8.68% mozilla::layers::CloneLayerTreePropertiesInternal(mozilla::layers::Layer*)                 
>         + 8.45% nsDisplayBackground::AllocateGeometry(nsDisplayListBuilder*)                               
>         + 7.59% _ZN11gfxASurface13SetOpaqueRectERK7gfxRect.clone.1                                         
>         + 7.48% _ZN13nsTArray_baseI24nsTArrayDefaultAllocatorE14EnsureCapacityEjj.clone.6                  
>      [...]
>-   1.87%  firefox  firefox                      [.] malloc                                                 
>   - malloc                                                                                                 
>      + 48.31% g_malloc                                                                                     
>      - 17.42% moz_xmalloc                                                                                  
>         + 44.74% mozilla::layers::CloneLayerTreePropertiesInternal(mozilla::layers::Layer*)                
>         + 9.47% mozilla::layers::BasicLayerManager::EndTransactionInternal(void (*)(mozilla::layers::Thebes
>         + 9.21% gfxUtils::DrawPixelSnapped(gfxContext*, gfxDrawable*, gfxMatrix const&, gfxRect const&, gfx
>         + 9.04% nsDisplayItem::AllocateGeometry(nsDisplayListBuilder*)                                     
>         + 8.86% nsTArray_base<nsTArrayDefaultAllocator>::EnsureCapacity(unsigned int, unsigned int)        
>         + 6.78% NS_NewDOMDragEvent(nsIDOMEvent**, nsPresContext*, nsDragEvent*)                            
>         + 6.28% UTF8ToNewUnicode(nsACString_internal const&, unsigned int*)                                
>         + 5.62% gfxXlibSurface::Create(Screen*, XRenderPictFormat*, nsIntSize const&, unsigned long)       
>       [...]
>-   1.79%  firefox  libxul.so                    [.] SearchTable(PLDHashTable*, void const*, unsigned int, P
>   - SearchTable(PLDHashTable*, void const*, unsigned int, PLDHashOperator)                                 
>      + 40.10% nsTHashtable<nsBaseHashtableET<nsCStringHashKey, nsAutoPtr<nsHttpConnectionMgr::nsConnectionE
>      + 10.84% PL_DHashTableOperate                                                                         
>      + 9.42% mozilla::FramePropertyTable::Get(nsIFrame const*, mozilla::FramePropertyDescriptor const*, boo
>      + 8.18% nsBindingManager::GetInsertionParent(nsIContent*)                                             
>      + 5.61% RuleHash::EnumerateAllRules(mozilla::dom::Element*, RuleProcessorData*, NodeMatchContext&)    
>      + 5.59% mozilla::FrameLayerBuilder::StoreDataForFrame(nsDisplayItem*, mozilla::FrameLayerBuilder::Disp
>      + 3.61% nsPropertyTable::GetPropertyInternal(nsPropertyOwner, nsIAtom*, bool, tag_nsresult*)          
>      + 2.67% nsIDOMXULElement_GetBoxObject(JSContext*, JS::Handle<JSObject*>, JS::Handle<long>, JS::Mutable
>      + 2.32% nsStaticCaseInsensitiveNameTable::Lookup(nsAString_internal const&)                           
>      + 1.89% nsStyleContext::~nsStyleContext()                                                             
>      + 1.51% nsComponentManagerImpl::GetServiceByContractID(char const*, nsID const&, void**)              
>      + 1.37% nsTHashtable<nsBaseHashtableET<nsISupportsHashKey, nsCOMPtr<imgIRequest> > >::GetEntry(nsISupp
>      + 1.20% nsComponentManagerImpl::GetService(nsID const&, nsID const&, void**)                          
>      + 1.17% nsTHashtable<nsCookieEntry>::GetEntry(nsCookieKey const&) const                               
>      + 1.17% mozilla::css::RestyleTracker::GetRestyleData(mozilla::dom::Element*, mozilla::css::RestyleTrac
>      + 1.16% nsBindingManager::GetBinding(nsIContent*)                                                     
>      + 1.10% nsScriptNameSpaceManager::LookupNameInternal(nsAString_internal const&, unsigned short const**
>      + 1.09% mozilla::Preferences::GetBool(char const*, bool*)                                             
>-   1.42%  firefox  libpthread-2.15.so           [.] pthread_mutex_unlock                                   
>   - pthread_mutex_unlock                                                                                   
>      - 13.23% moz_xmalloc                                                                                  
>         + 44.36% NS_NewDOMNotifyPaintEvent(nsIDOMEvent**, nsPresContext*, nsEvent*, unsigned int, nsInvalid
>         + 25.15% gfxXlibSurface::Create(Screen*, XRenderPictFormat*, nsIntSize const&, unsigned long)      
>         + 19.26% nsDisplayText::AllocateGeometry(nsDisplayListBuilder*)                                    
>         + 11.23% nsMemory::Clone(void const*, unsigned long)                                               
>      + 11.07% moz_xrealloc                                                                                 
>      + 8.47% mozilla::FrameLayerBuilder::UpdateDisplayItemDataForFrame(nsRefPtrHashKey<mozilla::FrameLayerB
>        7.77% 0x7feb0e1b3dd5                                                                                
>        7.44% 0x7feb10f51166                                                                                
>      + 7.24% 0x7feb166dd000                                                                                
>      + 4.79% XPCConvert::NativeInterface2JSObject(XPCLazyCallContext&, JS::Value*, nsIXPConnectJSObjectHold
>      + 3.16% xpc_TryUnmarkWrappedGrayObject(nsISupports*)                                                  
>        3.02% 0x7feb0e1b3537                                                                                
>      + 3.01% _cairo_gstate_fill                                                                            
>      + 2.98% gfxSurfaceDrawable::Draw(gfxContext*, gfxRect const&, bool, gfxPattern::GraphicsFilter const&,
>-   1.33%  firefox  firefox                      [.] arena_run_tree_insert                                  
>   - arena_run_tree_insert                                                                                  
>      + 96.50% free                                                                                         
>      + 1.86% realloc                                                                                       
>        1.64% 0x7feb1128d93b                                                                                
>-   1.25%  firefox  firefox                      [.] arena_run_tree_remove                                  
>   - arena_run_tree_remove                                                                                  
>      - 94.12% arena_bin_nonfull_run_get                                                                    
>         - 92.97% malloc                                                                                    
>            - 40.98% moz_xmalloc                                                                            
>               + 22.81% mozilla::FrameLayerBuilder::AddLayerDisplayItem(mozilla::layers::Layer*, nsDisplayIt
>               + 11.38% nsRunnableMethodTraits<void (nsPresContext::*)(), true>::base_type* NS_NewRunnableMe
>               + 10.14% nsTArray_base<nsTArrayDefaultAllocator>::EnsureCapacity(unsigned int, unsigned int) 
>               + 6.68% nsScriptSecurityManager::CreateCodebasePrincipal(nsIURI*, unsigned int, bool, nsIPrin
>               + 6.06% imgFrame::SurfaceForDrawing(bool, bool, bool, nsIntMargin const&, gfxMatrix&, gfxRect
>               + 6.03% XPCWrappedNative::GetNewOrUsed(XPCCallContext&, xpcObjectHelper&, XPCWrappedNativeSco
>               + 5.96% nsDisplayBackground::AllocateGeometry(nsDisplayListBuilder*)                         
>               + 5.78% nsDisplayText::AllocateGeometry(nsDisplayListBuilder*)                               
>               + 5.40% nsTArray_base<nsTArrayInfallibleAllocator>::EnsureCapacity(unsigned int, unsigned int
>               + 5.25% nsArray::Create()                                                                    
>               + 4.88% nsStyleAnimation::ExtractComputedValue(nsCSSProperty, nsStyleContext*, nsStyleAnimati
>               + 4.88% mozilla::css::StyleRule::DeclarationChanged(mozilla::css::Declaration*, bool)        
>               + 4.75% mozilla::css::Declaration::EnsureMutable()                                           
>              21.00% 0x7feb0e1b34ce                                                                         
>              11.40% g_malloc                                                                               
>         + 7.03% realloc                                                                                    
>      + 5.88% malloc                                                                                        
>-   1.25%  firefox  firefox                      [.] arena_bin_nonfull_run_get                              
>   - arena_bin_nonfull_run_get                                                                              
>      - 94.47% malloc                                                                                       
>         - 39.84% moz_xmalloc                                                                               
>            - 17.33% nsTArray_base<nsTArrayDefaultAllocator>::EnsureCapacity(unsigned int, unsigned int)    
>               + 63.13% nsStyleDisplay::nsStyleDisplay(nsStyleDisplay const&)                               
>               + 36.87% mozilla::FrameLayerBuilder::StoreNewDisplayItemData(mozilla::FrameLayerBuilder::Disp
>            + 17.07% mozilla::FrameLayerBuilder::AddLayerDisplayItem(mozilla::layers::Layer*, nsDisplayItem*
>            + 9.96% nsCSSValue::Array::Create(unsigned long)                                                
>            + 6.44% ToNewCString(nsACString_internal const&)                                                
>            + 6.28% nsDisplayBackground::AllocateGeometry(nsDisplayListBuilder*)                            
>            + 5.90% nsMemory::Clone(void const*, unsigned long)                                             
>            + 5.59% nsCSSValue::SetListValue()                                                              
>            + 5.58% XPCWrappedNativeProto::GetNewOrUsed(XPCCallContext&, XPCWrappedNativeScope*, nsIClassInf
>            + 5.52% mozilla::FrameLayerBuilder::AddThebesDisplayItem(mozilla::layers::ThebesLayer*, nsDispla
>            + 5.50% XPCWrappedNative::GetNewOrUsed(XPCCallContext&, xpcObjectHelper&, XPCWrappedNativeScope*
>            + 5.25% NS_NewComputedDOMStyle(mozilla::dom::Element*, nsAString_internal const&, nsIPresShell*)
>            + 4.95% nsDisplayText::AllocateGeometry(nsDisplayListBuilder*)                                  
>            + 4.63% nsStyleAnimation::ExtractComputedValue(nsCSSProperty, nsStyleContext*, nsStyleAnimation:
>           19.40% 0x7feb0e1b34ce                                                                            
>           13.95% g_malloc
I don't know who on layout and front-end to cc here; roc and margaret, can you cc the right people?
Frank or Jared, are you the right people to look into this?
This is a duplicate of bug 685702 that I filed over a year ago while I was still working on this.

I'll move everything over to that bug.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Whiteboard: [snappy]
Duplicate of bug: 685702
Are you sure this is a dupe?  It seems to have regressed; I recall this being buttery-smooth a week or two ago.
(In reply to Justin Lebar [:jlebar] from comment #7)
> Are you sure this is a dupe?  It seems to have regressed; I recall this
> being buttery-smooth a week or two ago.

Ah, I'll undo the duping then. Apologies for the churn.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Whiteboard: [snappy]
Status: REOPENED → NEW
Anthony - Can QA help with the identification of the regression window for this Snappy bug?
Are those who see this using the Gecko profiler extension?
It's buttery-smooth for me now.  I don't know if this is an intermittent problem or if it's fixed, but since nobody else has been complaining, I can close this until I see it again.
Status: NEW → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → WORKSFORME
I can reproduce this in some scenarios, but it's not all the time. Here are two SPS profiles that I just created:
http://people.mozilla.com/~bgirard/cleopatra/?report=28d3b0af067de6bfa268ae53e1744308db61a92a
http://people.mozilla.com/~bgirard/cleopatra/?report=5d0ff1cc1f527cf2da727344287aadc94fbcd212
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
OS: Linux → All
Hardware: x86_64 → All
For comment #12, these are the URLs that I had open:
https://tbpl.mozilla.org/?tree=UX&rev=1befa10d02b9
https://mail.mozilla.com/zimbra/#1
https://mail.google.com/mail
http://blip.tv/jsconfeu/jared-wyles-javascript-what-could-have-been-5681434
https://bugzilla.mozilla.org/show_bug.cgi?id=805217
https://irccloud.com/#!/ircs://irc.mozilla.org:6697/%23fx-team

IRCCloud is known to cause jank, the flash video playing in the blip.tv tab can cause jank, and TBPL + GMail are can cause high memory usage. I am running the 10/31 Nightly on Windows 7.
(In reply to Jared Wein [:jaws] from comment #13)
> IRCCloud is known to cause jank, the flash video playing in the blip.tv tab
> can cause jank,

At which point this wouldn't be specific to the tab sliding animation anymore and this bug would have outlived its usefulness...
I only wanted to mention that because that may help to reproduce this bug. There may still be some optimizations we can make in _animateTabMove.
(In reply to Jared Wein [:jaws] from comment #15)
> I only wanted to mention that because that may help to reproduce this bug.

Sure. I'm saying reproducing under those circumstances isn't useful.

> There may still be some optimizations we can make in _animateTabMove.

Those would probably not get rid of the jank you saw and thus be a separate bug.
(In reply to Lawrence Mandel [:lmandel] from comment #9)
> Anthony - Can QA help with the identification of the regression window for
> this Snappy bug?

I've not been able to reproduce this bug. I don't think we can find a regression range until we have a reliably reproducible case. Is this reliably reproducible for anyone? If so, can you provide some steps or find the regression range?
Closing this again. If you can reproduce the regression this bug was filed for (not just general sluggishness under heavy load), please reopen. Bonus points for providing the regression range.

Loose ideas for improving _animateTabMove should go into separate bugs.
Status: REOPENED → RESOLVED
Closed: 7 years ago7 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.