Closed Bug 807408 Opened 12 years ago Closed 10 days ago

laggy text entry

Categories

(Core :: JavaScript Engine, defect)

x86_64
Windows 7
defect

Tracking

()

RESOLVED INACTIVE

People

(Reporter: taras.mozilla, Unassigned)

References

Details

(Whiteboard: [Snappy:P1][leave open][js:t])

Attachments

(2 files)

Holdin down a key on repeat in bugzilla(while in balanced perf profile in win7) results in laggy text input. See http://people.mozilla.com/~bgirard/cleopatra/?report=9dd651fb9b9623449feae2e07cf9445b1a39464a

See http://people.mozilla.com/~bgirard/cleopatra/?report=deecf01f076502ca7529bd083d5f4ab0cd984fcc for similar lag in gmail
Attached file memchaser log for bill
Here's my thoughts on what's happening here.

Each key press is causing two paints:
1. from the refresh driver
2. from nsWindow::DispatchStarvedPaints

I'm not sure why we're getting two paints per keypress and that seems wrong. Why are we getting WM_PAINTs right after we've just painted? Where are they coming from?

The real badness it seems is in GC though. Every time we go into DispatchStarvedPaints we do two GCs and both are more expensive than the paint.
Assignee: nobody → general
Component: Graphics → JavaScript Engine
To be clear, about 86% of the time in starvedpaint is in GC
Depends on: 807472
Untested, but this should remove around 9% of the profile.
Attachment #677163 - Flags: review?(jmuizelaar)
Comment on attachment 677163 [details] [diff] [review]
Cache the dummy target for no-composite transactions

Review of attachment 677163 [details] [diff] [review]:
-----------------------------------------------------------------

::: gfx/layers/basic/BasicLayerManager.cpp
@@ +541,5 @@
> +      // TODO: We should really just set mTarget to null and make sure we can handle that further down the call chain
> +      nsRefPtr<gfxASurface> surf = gfxPlatform::GetPlatform()->CreateOffscreenSurface(gfxIntSize(1, 1), gfxASurface::CONTENT_COLOR);
> +      mDummyTarget = new gfxContext(surf);
> +    }
> +    mTarget = mDummyTarget;

Is this missing a header change? If so it might be good to give mDummyTarget a more descriptive name like m1x1DummyTarget. You should also add a comment about why it's important enough to cache this surface.
Attachment #677163 - Flags: review?(jmuizelaar) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/7e2d29d8f825

Need to evaluate if this is still an issue with the above patch, and bug 807472.
Whiteboard: [Snappy:P1] → [Snappy:P1][leave open]
Whiteboard: [Snappy:P1][leave open] → [Snappy:P1][leave open][js:t]
Assignee: general → nobody
Severity: normal → S3
Status: NEW → RESOLVED
Closed: 10 days ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: