pressing Enter in a large textarea is very CPU intensive with Firefox 4.0
Bug #677551 reported by
Jamie Strandboge
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mozilla Firefox |
Fix Released
|
Medium
|
|||
firefox (Ubuntu) |
Fix Released
|
High
|
Chris Coulson | ||
Natty |
Fix Released
|
High
|
Chris Coulson |
Bug Description
Binary package hint: firefox
On up to date natty with Firefox 4.0, pressing Enter in a large textarea is very CPU intensive.
Go to:
https:/
Edit the page, and then click 'Enter' a few times at the top of the editing textarea. The CPU will spike. Holding 'Enter' pegs the CPU entirely (there is no need to commit your changes). This is a regression over 3.6 on Ubuntu 10.10.
description: | updated |
description: | updated |
summary: |
- pressing Enter in a large textarea is very CPU intensive + pressing Enter in a large textarea is very CPU intensive with Firefox + 4.0 |
description: | updated |
Changed in firefox (Ubuntu): | |
importance: | Undecided → Medium |
assignee: | nobody → Chris Coulson (chrisccoulson) |
Changed in firefox (Ubuntu): | |
status: | New → Confirmed |
affects: | firefox (Ubuntu) → ubuntu |
affects: | Ubuntu Natty → firefox (Ubuntu Natty) |
Changed in firefox (Ubuntu Natty): | |
importance: | Medium → High |
status: | Confirmed → Triaged |
Changed in firefox: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in firefox: | |
status: | Confirmed → Fix Released |
Profile (on Mac) says 95% of the time is spent in the reflow that we trigger from EndUpdateViewBatch. Even more interestingly, 93% is under nsLineLayout: :TrimTrailingWh iteSpace and almost all of this is under EnsureTextRun. Sounds like we're recreating textruns for the whole thing, presumably because inserting some text marked them all dirty?
Oh, and we're spending most of our time here on line-breaking in the textrun code.
Are we trying to trim trailing whitespace all down the line, or are we just creating huge textrun? I thought we limited textrun length or something... and we shouldn't have to trim trailing whitespace all down the line (and in fact, should be able to stop the reflow at the next line that ends in a newline char, yes?)