Closed Bug 1431183 Opened 6 years ago Closed 6 years ago

High background CPU usage when WebRender enabled (profile attached)

Categories

(Core :: Graphics: WebRender, defect, P4)

x86_64
macOS
defect

Tracking

()

RESOLVED INACTIVE
Tracking Status
firefox59 --- affected

People

(Reporter: rnewman, Unassigned, NeedInfo)

References

Details

(Keywords: perf)

Attachments

(1 file)

Attached file 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.
Keywords: perf
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)
Depends on: 1431283
No longer depends on: 1431283
This should be a lot better now. Do you still see the problem?
Flags: needinfo?(bugzilla)
Priority: P2 → P3
Status: NEW → RESOLVED
Closed: 6 years ago
Priority: P3 → P4
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: