High background CPU usage when WebRender enabled (profile attached)

NEW
Unassigned

Status

()

Core
Graphics: WebRender
P2
normal
a month ago
a month ago

People

(Reporter: rnewman, Unassigned)

Tracking

(Blocks: 1 bug, {perf})

Trunk
x86_64
Mac OS X
Points:
---

Firefox Tracking Flags

(firefox59 affected)

Details

Attachments

(1 attachment)

(Reporter)

Description

a month ago
Created attachment 8943354 [details]
Instruments profile.

Current Nightly, `gfx.webrender.all = true`, multiple windows and tabs open.

The main `firefox` process is spinning 30% of one CPU. Firefox is foregrounded but inactive.

An Instruments profile shows the heaviest stacktrace as:

```
  24  676.0  firefox (9089) :0
  23  85.0  base::Thread::ThreadMain  0x792c6 :0
  22 libsystem_pthread.dylib 85.0  thread_start
  21 libsystem_pthread.dylib 85.0  _pthread_start
  20 libsystem_pthread.dylib 85.0  _pthread_body
  19 XUL 85.0  ThreadFunc(void*)
  18 XUL 85.0  base::Thread::ThreadMain()
  17 XUL 85.0  MessageLoop::Run()
  16 XUL 85.0  base::MessagePumpDefault::Run(base::MessagePump::Delegate*)
  15 XUL 75.0  MessageLoop::DoWork()
  14 XUL 74.0  MessageLoop::DeferOrRunPendingTask(MessageLoop::PendingTask&&)
  13 XUL 36.0  mozilla::detail::RunnableMethodImpl<mozilla::layers::CompositorVsyncScheduler*, void (mozilla::layers::CompositorVsyncScheduler::*)(mozilla::TimeStamp), true, (mozilla::RunnableKind)1, mozilla::TimeStamp>::Run()
  12 XUL 36.0  mozilla::layers::CompositorVsyncScheduler::Composite(mozilla::TimeStamp)
  11 XUL 36.0  mozilla::layers::WebRenderBridgeParent::CompositeToTarget(mozilla::gfx::DrawTarget*, mozilla::gfx::IntRectTyped<mozilla::gfx::UnknownUnits> const*)
  10 XUL 29.0  mozilla::layers::WebRenderBridgeParent::SampleAnimations(nsTArray<mozilla::wr::WrOpacityProperty>&, nsTArray<mozilla::wr::WrTransformProperty>&)
   9 XUL 28.0  mozilla::layers::WebRenderBridgeParent::AdvanceAnimations()
   8 XUL 28.0  mozilla::layers::AnimationHelper::SampleAnimations(mozilla::layers::CompositorAnimationStorage*, mozilla::TimeStamp)
   7 XUL 14.0  mozilla::layers::AnimationHelper::SetAnimations(nsTArray<mozilla::layers::Animation>&, nsTArray<mozilla::layers::AnimData>&, mozilla::AnimationValue&)
   6 XUL 9.0  mozilla::layers::ToAnimationValue(mozilla::layers::Animatable const&)
   5 XUL 5.0  mozilla::AnimationValue::Opacity(mozilla::StyleBackendType, float)
   4 XUL 5.0  Servo_AnimationValue_Opacity
   3 libmozglue.dylib 5.0  Allocator<MozJemallocBase>::malloc(unsigned long)
   2 libmozglue.dylib 5.0  BaseAllocator::malloc(unsigned long)
   1 libmozglue.dylib 3.0  arena_t::MallocSmall(unsigned long, bool)
   0 libmozglue.dylib 2.0  arena_t::GetNonFullBinRun(arena_bin_t*)

```

and there also seems to be significant work done in creating new threads.

Profile attached.
(Reporter)

Updated

a month ago
Keywords: perf
Blocks: 1386669
Priority: -- → P2
(Reporter)

Comment 1

a month ago
Milan, did you intend for this to block the Windows train bug?
Flags: needinfo?(milan)
Right - with P2 and stage-wr-trains, it won't block Windows trains, but it's still going to be tracked and we'll give priority to it once we take care of P1s.
Flags: needinfo?(milan)

Updated

a month ago
Depends on: 1431283

Updated

a month ago
No longer depends on: 1431283
You need to log in before you can comment on or make changes to this bug.