The default bug view has changed. See this FAQ.

View source slower in Firefox 15 (hangs with high cpu for seconds) on some (many?) HTML pages

VERIFIED FIXED in Firefox 15

Status

()

Toolkit
View Source
VERIFIED FIXED
5 years ago
5 years ago

People

(Reporter: Nickolay_Ponomarev, Assigned: smontagu)

Tracking

({perf, regression, testcase})

Trunk
mozilla15
x86
Mac OS X
perf, regression, testcase
Points:
---

Firefox Tracking Flags

(firefox15+ fixed)

Details

Attachments

(4 attachments, 2 obsolete attachments)

(Reporter)

Description

5 years ago
Created attachment 629576 [details]
original page demonstrating the slowdown

STR: open attached file, select Tools -> Web developer -> Page source (Cmd+U).

Actual results: the page source is empty for a few seconds, during which Firefox uses 100% cpu doing reflow.

Expected results: view source should display as fast as in Firefox 14.

Regression window points to bug 751841:

Good: http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-inbound-macosx64/1338359573/firefox-15.0a1.en-US.mac.dmg
(built from http://hg.mozilla.org/integration/mozilla-inbound/rev/b613ac5ff64a)

Bad: http://ftp.mozilla.org/pub/mozilla.org/firefox/tinderbox-builds/mozilla-inbound-macosx64/1338360714/firefox-15.0a1.en-US.mac.dmg
(built from http://hg.mozilla.org/integration/mozilla-inbound/rev/e98f0fc3d02e)

According the the built-in profiler, with the patch we spend 4.5 seconds on my machine under PresShell::DoReflow, whereas before the patch it was 1 second.

I tried to simplify the page and I see the slowdown with
1) a long line with entity references (")
2) many lines, with or without entity references
(Reporter)

Updated

5 years ago
Keywords: perf, regression, testcase
(Reporter)

Comment 1

5 years ago
Created attachment 629578 [details]
testcase 1: many lines
(Reporter)

Comment 2

5 years ago
Created attachment 629579 [details]
testcase 2: single line, but many entity references
(Assignee)

Comment 3

5 years ago
Created attachment 629592 [details] [diff] [review]
Patch

This possibly needs to be split into two bugs, something like a) performance is bad with lots of elements with unicode-bidi: isolate; b) view-source uses lots of elements with unicode-bidi: isolate.

This is a patch for b), i.e. it fixes the issue with view-source slowdown, but there could be similar slowdown in other cases.
Assignee: nobody → smontagu
(Assignee)

Updated

5 years ago
Attachment #629592 - Flags: review?(ehsan)
(Assignee)

Comment 4

5 years ago
Created attachment 629593 [details] [diff] [review]
Correct diff
Attachment #629592 - Attachment is obsolete: true
Attachment #629592 - Flags: review?(ehsan)
Attachment #629593 - Flags: review?(ehsan)
(Assignee)

Comment 5

5 years ago
I have *no* clue where that first hunk is coming from :(
(Assignee)

Comment 6

5 years ago
Created attachment 629594 [details] [diff] [review]
Correct diff
Attachment #629593 - Attachment is obsolete: true
Attachment #629593 - Flags: review?(ehsan)
Attachment #629594 - Flags: review?(ehsan)

Updated

5 years ago
Attachment #629594 - Flags: review?(ehsan) → review+

Updated

5 years ago
status-firefox15: --- → affected
tracking-firefox15: ? → +
I went ahead and landed the patch: http://hg.mozilla.org/mozilla-central/rev/42f8002ca13b
Status: NEW → RESOLVED
Last Resolved: 5 years ago
status-firefox15: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla15
(Reporter)

Comment 8

5 years ago
Thanks for the quick fix! The issue is now fixed for me.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.