Closed
Bug 146831
Opened 23 years ago
Closed 23 years ago
The CPU usage around 90% when load Netscape homepage
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.0.1
People
(Reporter: amyy, Assigned: dbaron)
References
()
Details
(Keywords: perf, topembed+)
Attachments
(4 files, 5 obsolete files)
171.66 KB,
image/jpeg
|
Details | |
4.92 KB,
patch
|
kinmoz
:
review+
waterson
:
superreview+
jud
:
approval+
|
Details | Diff | Splinter Review |
5.84 KB,
patch
|
Details | Diff | Splinter Review | |
5.71 KB,
patch
|
Details | Diff | Splinter Review |
Build: N7.0PR1 win32 build on WinXP-SimpChinese
With page http://home.netscape.com/ loaded, the CPU usage always very high
(about 90%). It will be really slow when I try to do some other things, e.g.
Enable IME in Composer window to typing some other languages.
This problem appears after netscape.com page updated recently, I think it's
because now the page has a "marquee" scroll message simulation JavaScript right now.
I'm not quite sure if it's an envangelist issue or our application issue, I'm
filing bug for JavaScript for now, please change the component if needed.
Reporter | ||
Comment 1•23 years ago
|
||
If I scroll down this page, then the CPU usage will go down about 30-40%.
FYI: a lots of SimpChinese web pages are using the scroll message, here are some
examples pages which are in top 5 SimpChinese pages from some date report:
http://www.sina.com.cn/
http://www.sohu.com/
http://www.stockstar.com/home.htm
Reporter | ||
Comment 2•23 years ago
|
||
> If I scroll down this page, then the CPU usage will go down about 30-40%.
If I scroll down this page to hiding the JavaScript part, then the CPU usage
will go down about 30-40%.
I don't have this problem on my SC XP with US 7.0PR1 and SC 7.0PR1 rc1. I always
get 35% after starting http://home.netscape.com/ .
Comment 4•23 years ago
|
||
Rui Xu: I came to see you to try the bug on your machine, but you aren't there.
So I took a liberty of testing it without your presence.
Indeed, your CPU doesnt' go up to near 90%; but it maintains at 35%.
And as soon as I scroll down the netscape page, CPU goes down to 2%.
IE, on the other hand, only bump CPU to max 8%.
I think Netscape browser _keeps_ too much CPU.
Roy and I just tested again on my SC XP pro, and got the screen shot for
comparison.
Comment 6•23 years ago
|
||
I saw this and the simulated marquee appears to use so much CPU that
the Japanese IME was unusable. The IME has a "fade in" style animation effect.
When the simulated marquee is running the IME fade in takes so long that the
user is confused and thinks they did not engage the IME. Because they think
they did not turn it on they end up turning it on/off/on/off ... further
compounding the CPU load and slowness.
Comment 7•23 years ago
|
||
The performance issues here are in the browser code, not JS Engine.
Reassigning to DOM Level 0. I know there was recent talk about this
marquee. This may be a duplicate of
bug 145152 Scrolling JS banner causes caret to "rapidly blink" in field
where the comment was made,
"This page also slows my system (G3 Powerbook) to a crawl."
Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
QA Contact: pschwartau → desale
Comment 8•23 years ago
|
||
see also http://developer.netscape.com/evangelism/examples/stock-ticker/ which
is the original example the netscape.com ticker was derived from. The example
ticker does not load the cpu.
I think there is an interaction with the markup on the page causes the cpu load.
I tried blocking mutation events and could not make a difference in the load.
Increasing the interval from 45 ms to 100 ms will drop the cpu load from 100% on
my PIII 700 to about 50%.
Note that the netscape.com home page shows high cpu load even on Mozilla 2002 05
30 08 trunk.
Comment 9•23 years ago
|
||
FYI, I'm writting a new ticker together with bclary that currently barelly uses
3% cpu, and am working with netcenter on this.
Comment 10•23 years ago
|
||
http://blues.mcom.com/users/doron/publish/testcase.html
Here is a somewhat reduced testcase. Removing the following inline css:
#navcontent
{ position:absolute; text-align: right; top:240; width:145; }
reduces the cpu usage tremendously.
Reporter | ||
Comment 11•23 years ago
|
||
Yes, I tried the above testcase, after I removed:
#navcontent... css style sheet, the CPU usage down from 90% to around 35%.
Reporter | ||
Comment 12•23 years ago
|
||
cc momoi@netscape.com who might interested in this "marquee" simulation JavaScript.
Assignee | ||
Comment 13•23 years ago
|
||
This is a possible fix, but it needs a good bit of testing. And I need to talk
to waterson about it...
Assignee | ||
Comment 14•23 years ago
|
||
So it looks like what was going on is that there's an absolutely positioned
element within a table cell that is in the same row as the cell containing the
ticker. It actually doesn't matter that their in the same row, because the real
absolute frame (not the placeholder) is parented to the block that is the child
of the canvas frame (the root element's frame).
I sat down to debug this with smontagu and darin. I discovered from loading
doron's testcase in viewer and turning on visual debugging that the absolutely
positioned element in the testcase was flashing while repainting (I have
double-buffering turned off in my debug build, I think). I put in printfs with
stack traces in nsFrame::Invalidate and found the stack trace that was leading
to these invalidates.
Basically what is happening is that when we do an incremental reflow targeted at
the ticker, since one of the ancestors of the ticker contains absolutely
positioned elements, we reflow all the absolutely positioned elements inside
that container. (I think this means that we reflow all absolutely positioned
elements for any incremental reflow, which is even worse than the extra reflow
we do to find the overflow area after calling
mAbsoluteContainer.IncrementalReflow.) So there are two problems:
1) We're doing this reflow when we don't need to.
2) This reflow leads to invalidates, even though nothing has changed.
I suspect (2) is somehow related to one of the major design flaws in layout --
the handling of min size / pref size within the same Reflow method and involving
the repositioning of frames, although BRS_COMPUTEMAXWIDTH, etc., might be able
to handle something like this. It could be something simple, too, though. I
think we were seeing invalidates from ReflowLine (invalidating the line box --
perhaps alexsavulov's change a few months ago?) and invalidates of the text
frame from some nsTextFrame code (which suggests to me that it involves
unconstrained/constrained jiggling due to the right-justification).
This patch addresses problem (1). It looks like it's correct, but I'm still a
bit worried about any regressions it might cause (due to other problems that it
could be covering up). I'd like to get the opinions of waterson, kin, and others.
Someone should still try this on Windows and make sure it solves the performance
problem there as well.
Comment 15•23 years ago
|
||
On a Windows debug build without the patch CPU usage swings between 66% and 100%
depending on whether the ticker (or the absolutely positioned element) is hidden
or covered. With the patch CPU usage is fairly constant at 42%.
This is still a lot. Could we get more of a win by doing something along the
lines of bug 135146 comment 22?
Assignee | ||
Comment 16•23 years ago
|
||
This is the same as the previous one, but also changes some really obscure code
that is doing the same thing.
What smontagu mentions in comment 15 *might* be helpful -- we'd need to profile
with the patch to see what we're busy doing in that 42%.
Attachment #86331 -
Attachment is obsolete: true
Comment 17•23 years ago
|
||
As a quick and dirty proof of concept I copied code from bug 135146 to make
table cells act as reflow roots.
CPU was standing at 3% (and the ticker was working) until I crashed.
Assignee | ||
Comment 18•23 years ago
|
||
I think I got the logic a little wrong regarding the case of a block that's the
target of an incremental reflow, and this should fix it.
Attachment #86348 -
Attachment is obsolete: true
Assignee | ||
Comment 19•23 years ago
|
||
Here's a slightly more realistic reflow-roots patch. I've only tested this for
about 2 minutes, though. I'd be curious to know if this also helps the time.
Attachment #86349 -
Attachment is obsolete: true
Assignee | ||
Comment 20•23 years ago
|
||
Comment on attachment 86356 [details] [diff] [review]
reflow roots hack, v. 1
The nsCSSFrameConstructor.cpp change within this patch is really an insufficent
attempt to fix a tiny piece of bug 149203.
Assignee | ||
Comment 22•23 years ago
|
||
I'm going to attach replacements for both of the patches shortly...
Assignee | ||
Comment 24•23 years ago
|
||
Attachment #86350 -
Attachment is obsolete: true
Assignee | ||
Comment 25•23 years ago
|
||
We'd really also want to fix bug 149203, though, even if this works.
Attachment #86356 -
Attachment is obsolete: true
Comment 26•23 years ago
|
||
Comment on attachment 86445 [details] [diff] [review]
reflow roots hack, v. 2
I'm afraid neither this nor the previous version seems to have any perceptible
effect on the CPU usage.
Comment 27•23 years ago
|
||
*** Bug 148825 has been marked as a duplicate of this bug. ***
Comment 28•23 years ago
|
||
*** Bug 145152 has been marked as a duplicate of this bug. ***
Comment 29•23 years ago
|
||
This bug marked as blocker for 147975 because it affects the loading of
http://home.netscape.com/apple.adp, which is now the default chimera home page.
Chimera bugs 145152 and 148825 were originally filed for this problem, and have
been marked as dupes of this bug.
Comment 31•23 years ago
|
||
Comment on attachment 86443 [details] [diff] [review]
extra absolute reflow patch, v. 4
sr=waterson
Attachment #86443 -
Flags: superreview+
Comment 32•23 years ago
|
||
I've tried attachment 86443 [details] [diff] [review] in branch and trunk builds on win2k (pulled today).
Without the patch, I was at almost 100% cpu viewing home.netscape.com.
With the patch
(case A) branch and trunk run at about 30% cpu, dropping to 10% cpu when the
window is completely covered;
(case B) trunk has been observed to drop to 0% cpu, but this comes and goes.
I haven't (yet) seen this occur in the branch, but that may just
be chance (but perhaps it's because nsBlockFrame.cpp on the
branch has other, significant differences from the trunk version)
Comment 33•23 years ago
|
||
*** Bug 150636 has been marked as a duplicate of this bug. ***
Comment 34•23 years ago
|
||
Comment on attachment 86443 [details] [diff] [review]
extra absolute reflow patch, v. 4
r=kin@netscape.com
Attachment #86443 -
Flags: review+
Assignee | ||
Comment 35•23 years ago
|
||
Primary fix (attachment 86443 [details] [diff] [review]) checked in to trunk 2002-06-11 20:21 PDT.
Assignee | ||
Updated•23 years ago
|
Whiteboard: [open1.0.1]
Updated•23 years ago
|
Comment 36•23 years ago
|
||
Looking for a review of this modified version of the patch to check into the
Chimera branch (pre-reflow-path).
Assignee | ||
Comment 37•23 years ago
|
||
Comment on attachment 87575 [details] [diff] [review]
patch against the 1.0 release/chimera branch
waterson just sanity-checked this, so I'm comfortable with your landing it on
the Chimera branch.
Comment 38•23 years ago
|
||
checked into CHIMERA_M1_0_BRANCH.
Updated•23 years ago
|
Attachment #86443 -
Flags: approval+
Comment 39•23 years ago
|
||
please checkin to the 1.0.1 branch. once there, remove the "mozilla1.0.1+"
keyword and add the "fixed1.0.1" keyword.
Keywords: mozilla1.0.1 → mozilla1.0.1+
Assignee | ||
Comment 40•23 years ago
|
||
I just checked (at valeski's request) an optimized mfcembed build with and
without the patch (based on 6/13 evening trunk, by backing out the patch in that
tree). With the patch, I was seeing 0%-1% CPU on home.netscape.com, and without
the patch I was seeing about 20% CPU on home.netscape.com. This was on a 1.5GHz
Win2KPro machine.
Assignee | ||
Comment 41•23 years ago
|
||
Fix checked in to MOZILLA_1_0_BRANCH, 2002-06-20 20:32 PDT.
Filed bug 153273 for investigation of remaining performance problems on
http://home.netscape.com/ and marking this bug fixed since the keywords, etc.,
don't really apply any longer, and since it's cleaner to have one bug per
problem and this bug is already quite messy.
Status: NEW → RESOLVED
Closed: 23 years ago
Keywords: mozilla1.0.1+ → fixed1.0.1
Resolution: --- → FIXED
Whiteboard: [open1.0.1]
Target Milestone: --- → mozilla1.0.1
Comment 42•23 years ago
|
||
postumus adt1.0.1+ :-(
Comment 43•23 years ago
|
||
Should this have perf as a keyword?
Updated•23 years ago
|
Keywords: fixed1.0.1 → verified1.0.1
Comment 44•23 years ago
|
||
My browser:Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.1b) Gecko/20020716
www.netscape.com gives my cpu (450 MHz) a 45 percent workload. When I uncheck
Javascript to hold the CNN ticker, the percentage drops to 5-8. IE6 demands 8
percent with the ticker running.I suggest the bug needs some more consideration.
Assignee | ||
Comment 45•23 years ago
|
||
Bug 153273 covers further performance work.
You need to log in
before you can comment on or make changes to this bug.
Description
•