Closed Bug 379672 Opened 17 years ago Closed 16 years ago

Typing into OkCupid textarea is laggy (involves float, onkeypress that sets innerHTML)

Categories

(Core :: Graphics, defect)

x86
macOS
defect
Not set
major

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: jruderman, Assigned: vlad)

References

()

Details

(Keywords: perf, regression, testcase)

Attachments

(1 file)

Attached file simple testcase
Steps to reproduce:
1. Load the testcase.
2. Focus the textarea.
3. Bang on the keyboard for a few seconds.

Result: Lag; it takes seconds for Firefox to catch up.

Expected: No lag.

This regressed, or at least became much worse, starting in 2007-05-01 nightlies.  

About 90% of the time is spent under nsDisplayList::Paint, with 70% of that under nsCSSRendering::PaintBorder.

This makes typing messages in OkCupid painful, because you can't see what you're typing unless you slow way down.  (The testcase only captures about a third of the pain.)

I'm curious what the float:left has to do with the slowness.
Flags: blocking1.9?
Assignee: nobody → vladimir
Flags: blocking1.9? → blocking1.9+
Target Milestone: --- → mozilla1.9alpha6
This is pretty weird; I don't see any problems with this on win32.  I'll try on mac; there could be something weird going on with that platform.
FWIW, we've certainly had "slow typing" issues in Cocoa widgets before; iirc they've typically been Gecko doing too much extra redrawing/spellchecking/js counting, etc., and all the extra work has just been more expensive in Cocoa widget.
"PC/Mac OS X"? I didn't know that we support Hackintosh! :) Switching platform to Mac/Mac OS X.
Hardware: PC → Macintosh
We've been using "PC/Mac OS X" to represent Intel Mac.  (Using the "Hardware" field to really mean "CPU Architecture", since otherwise it doesn't mean much.)
Hardware: Macintosh → PC
Two notes:

1. The testcase seems to work fine in OSX with a recent (Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a6pre) Gecko/20070607 Minefield/3.0a6pre) version of Minefield.

2. The bug report seems related to bug 384231 - maybe a dupe?
The testcase still shows the problem for me.  Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.9a6pre) Gecko/20070611 Minefield/3.0a6pre
punting remaining a6 bugs to b1, all of these shipped in a5, so we're at least no worse off by doing so.
Target Milestone: mozilla1.9alpha6 → mozilla1.9beta1
So from my profile, we're basically spending a bunch (25%) of time essentially filling rectangles -- the background of the textfield, the blinky cursor, etc. Then we're spending another 10% drawing native widgets, and another 5% drawing the text glyphs.  Another 5% is spent drawing the spellcheck underlines.

I tried optimizing the rectangle rendering to call CGContextFillRect -- as far as I know, the fastest way to fill a rectangle on OSX -- and it made very little difference.  The rectangles are all integer aligned.

That said, I only see the problem if I really bang on the keyboard very quickly, and let the text drag out without any spaces (thereby totally blowing the text cache, among other things).  Not sure what to do about this.
> That said, I only see the problem if I really bang on the keyboard very
> quickly [...]

It's much worse on the actual site than in the testcase I attached.
Priority: -- → P3
Target Milestone: mozilla1.9 M8 → ---
Punting; can't reproduce/debug easily.
Flags: wanted1.9+
Flags: blocking1.9-
Flags: blocking1.9+
WFM with the testcase in comment 0, and WFM on the current okcupid site.  Testing with a Mac trunk debug(!) build.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: