Closed
Bug 638235
Opened 14 years ago
Closed 2 years ago
Analyze BenchJS performance
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: dmandelin, Unassigned)
References
()
Details
Attachments
(1 file, 1 obsolete file)
35.35 KB,
application/zip
|
Details |
There are currently 7 tests. Compared to Chrome 10, we are faster on test 5, but slower on the rest (times in seconds):
test Fx4 Cr10
1 2.009 0.794
2 7.989 3.198
3 5.722 3.716
4 0.199 0.088
5 0.1 0.351
6 0.821 0.771
7 0.201 0.057
17.04 8.98
Aggregation is by sum, so test 2 is the biggest problem right now.
Comment 1•14 years ago
|
||
For what it's worth, I've run this test before (in an earlier incarnation that included window.open and window.status). Except for maybe test 7, it's not js-bound as I recall.
In particular, test 1 and test 2 are measuring across timeouts; simply dropping my timeout clamp from 10ms to 4ms drops my runtimes by a factor of 2.5, to basically the same as Chrome. Dropping it to 1ms drops them by another factor of 3. So these tests are completely useless and I wouldn't worry about them too much.
Test 3, as I recall, is a more or less fair DOM + painting test, sorta, testing an operation whose performance doesn't matter much.
Test 4 might need measuring.
Test 5 is all DOM and CSS, last I checked. So is test 6. Can't hurt to double-check, I guess.
Reporter | ||
Comment 2•14 years ago
|
||
That was quick. :-) Do you think it's worth getting in touch with the creators about the timeout issue, or should we just wait until ours gets fixed?
Comment 3•14 years ago
|
||
I mailed whoever was maintaining this test about some issues back in 2003 several times, and was summarily ignored...
We could try contacting these people, especially if they're different. For the sake of all the wasted CPU cycles if nothing else. ;)
Comment 4•14 years ago
|
||
Comment 5•14 years ago
|
||
Attachment #519964 -
Attachment is obsolete: true
Comment 6•14 years ago
|
||
OK, so comparing times for Firefox with timeout clamp at 4ms and Chrome 10:
Test Fx Chrome
1 1.052 0.948
2 3.856 3.535
3 10.378 4.299
4 0.239 0.15
5 0.16 0.395
6 0.909 0.888
7 0.055 0.056
Some data on tests 1, 2, 3, 4, 6.
Comment 7•14 years ago
|
||
Er, some data coming up.
Comment 8•14 years ago
|
||
test 1:
30% of the time is running the script that's triggered by the timer firing on the string (!) that was passed to setTimeout. The time there is almost entirely under js::mjit::stubs::SetName calling js::proxy_SetProperty, calling JSWrapper::set, etc. The vast majority of this is ending up under xpconnect, so this is the window.status set the page does. I wonder whether we should quickstub that.. ;)
65% of the time is painting. Some of this will get better with painting/invalidation off the refresh driver, but I don't quite understand why we end up with the ridiculously deep stacks we get here for BildDisplayListForStackingContext, with lots of scrollframes and table stuff on the stack. :(
Comment 9•14 years ago
|
||
Test 2:
35% reflow before painting
39% painting
5% running the script it's ostensibly testing
lots of event loop overhead here.
Again, this will be helped by invalidation off the refresh driver.
Depends on: 598482
Comment 10•14 years ago
|
||
Test 3:
17% painting
16% event loop gunk
3% running JS
6% attribute-setting code in DOM
3% CanLoadImage security check
5% Converting strings to nsIURI objects
8% imgLoader::LoadImage gunk
13% imgRequestProxy::OnStopRequest calling nsDocLoader::OnStopRequest which does
stupid stuff. Bug 642551 filed.
16% image loads completing and calling Invalidate() from
nsImageFrame::OnStopDecode. Again, bug 598482 might help.
6% dispatching image load events.
Depends on: 642551
Comment 11•14 years ago
|
||
Test 4:
12% reflow before painting
24% painting
41% spellchecking (which chrome may or may not be running on this text before the
test finishes, depending on their setup)
8% what looks like a timer triggering the session save part of session restore
6% GC
3% running the JS, setting the values of the textareas, etc.
Comment 12•14 years ago
|
||
Test 6:
38% painting
3% cycle collection
3% session restore stuff
15% restyle processing (ReResolveStyleContext, CalcStyleDifference,
ResolveStyleFor, etc)
7% reflow
10% setting inline style.
5% getting inline style
3% eval() crud (more on this below).
3% other JS
The eval comes from this gem:
var thisspan=eval("document.getElementById('span'+i).style")
that runs for every piece of text for every move.
I looked at tests 5 and 7 briefly too. Test 5 performance is dominated by the innerHTML setter actually parsing the HTML for us, and a bit of GC. Test 7 seems to be 31% session restore saving the session, 12% GC, and most of the remainder js_Date, date_getDay, js_ConcatStrings, js_StringToNumber, that sort of thing.
Comment 13•11 years ago
|
||
Test 3 is ridiculously slow on Nightly!
The others are fine.
Comment 14•11 years ago
|
||
Ok, tested correctly after the results from others on Mozillazine Forums.
TEST 3 68.514 sec. (adblock plus + noscript)
TEST 3 32.135 sec. (only noscript)
TEST 3 9.216 sec. (without both)
Chrome: TEST 3 4.443 sec.
Updated•11 years ago
|
Flags: needinfo?(trev.moz)
Flags: needinfo?(g.maone)
Comment 15•11 years ago
|
||
(In reply to Guilherme Lima from comment #14)
> TEST 3 68.514 sec. (adblock plus + noscript)
> TEST 3 32.135 sec. (only noscript)
> TEST 3 9.216 sec. (without both)
Almost the only thing NoScript and Adblock Plus have in common about this test is being called by CanLoadImage(), with NoScript's implementation usually slightly faster especially for images.
"Test 3 replaces 1500 images as fast as possible. It repeats the procedure 60 times."
The result of turning an exclusively C++ almost NOP into a full fledged XPCOM->JavaScript call possibly doing a lot of regular expressions matching, and repeating this call 90000 times, is surprisingly fast IMHO.
Flags: needinfo?(g.maone)
Comment 16•11 years ago
|
||
Thanks Maone. Probably there's nothing useful to be done here, as it's not something we see on regular websites?
I see the problem with ABP was filled last year - bug 756805, so I'm removing the needinfo, sorry for bothering.
Flags: needinfo?(trev.moz)
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Updated•2 years ago
|
Severity: normal → S3
Comment 17•2 years ago
|
||
Firefox Nightly 112.0a1 (2023-02-26):
TEST 1 time: 0.852 sec.
TEST 2 time: 3.416 sec.
TEST 3 time: 2.526 sec.
TEST 4 time: 0.04 sec.
TEST 5 time: 0.039 sec.
TEST 6 time: 0.581 sec.
TEST 7 time: 0.023 sec.
Chromium 113.0.5616.0 (2023-02-25):
TEST 1 time: 0.847 sec.
TEST 2 time: 3.369 sec.
TEST 3 time: 3.562 sec.
TEST 4 time: 0.071 sec.
TEST 5 time: 0.032 sec.
TEST 6 time: 0.8 sec.
TEST 7 time: 0.019 sec.
Seems good now.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•