The default bug view has changed. See this FAQ.

Hang on certain site

RESOLVED FIXED in mozilla9

Status

()

Core
Layout: Text
--
critical
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: Alice0775 White, Assigned: jfkthame)

Tracking

(4 keywords)

Trunk
mozilla9
x86
Windows 7
hang, perf, regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

6 years ago
Created attachment 554368 [details]
WinDbg log

Build Identifier:
http://hg.mozilla.org/mozilla-central/rev/f69a10f23bf3
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0a1) Gecko/20110818 Firefox/9.0a1 ID:20110818030747

Browser hang




Reproducible: Always

Steps to Reproduce:
1. Open Firefox with clean profile
2. Open Page ( http://www.openspc2.org/JavaScript/benchmark/addText2/index.html )
3. 


Actual Results:
  Browser hang

Expected Results:
  Display page in about 3sec on 2.5GHz C2Q

Regression window(cached m-c hourly),
Works:
http://hg.mozilla.org/mozilla-central/rev/b2aeaf724c8d
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101208 Firefox/4.0b8pre ID:20101208215553
Hang:
http://hg.mozilla.org/mozilla-central/rev/0567fd4cf088
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0b8pre) Gecko/20101208 Firefox/4.0b8pre ID:20101208230203
Pushlog:
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=b2aeaf724c8d&tochange=0567fd4cf088

In local built(m-c repository)
built from 4861b72cc66d : hang
built from 0bd4cd152565 : fast

Triggered by:
4861b72cc66d	Jonathan Kew — bug 553981 - handle Hangul Jamo sequences and other special cases when marking clusters. r=karlt a=roc
(Reporter)

Comment 1

6 years ago
Created attachment 554372 [details]
hang testcase.html
(Reporter)

Comment 2

6 years ago
Created attachment 554373 [details]
not hang testcase.html
(Assignee)

Comment 3

6 years ago
Created attachment 554556 [details] [diff] [review]
patch, v1 - avoid calling SanitizeGlyphRuns repeatedly during textrun construction with multiple scripts

The pathological behavior here arises when we try to construct a single textrun that has many separate script runs within it. The code ends up calling SanitizeGlyphRuns each time it appends a new glyph run, and that iterates over all the existing runs, which means we get behavior that is of the order of O(n^2) where n is the number of distinct glyph runs in the complete textrun, or something horrible like that. The testcase here is a worst-case scenario because it has mixed scripts repeated over and over within a single string for which we construct a giant textrun.

This patch should solve the problem by just calling SanitizeGlyphRuns once at the end of textrun construction, instead of repeating it for each added piece.
(Assignee)

Comment 4

6 years ago
Tryserver builds with this patch available at https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jkew@mozilla.com-df8cd5194cfd/.
(Assignee)

Updated

6 years ago
Attachment #554556 - Flags: review?(jdaggett)
(Reporter)

Comment 5

6 years ago
The tryserver built is improved performance remarkably. (I expect early check-in!)
(Reporter)

Updated

6 years ago
Keywords: hang, perf, testcase
(Assignee)

Comment 6

6 years ago
jdaggett, review ping? This is a simple fix for a bad regression....

Comment 7

6 years ago
Comment on attachment 554556 [details] [diff] [review]
patch, v1 - avoid calling SanitizeGlyphRuns repeatedly during textrun construction with multiple scripts

Looks fine, but I think you should add a comment noting the details in comment 3 so that we remember what to avoid when restructuring code in the future.
Attachment #554556 - Flags: review?(jdaggett) → review+
(Assignee)

Comment 8

6 years ago
Pushed to inbound, with extra comments:
http://hg.mozilla.org/integration/mozilla-inbound/rev/153a1de6cd67
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/153a1de6cd67
Assignee: nobody → jfkthame
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla9
You need to log in before you can comment on or make changes to this bug.