[Webkit-unassigned] [Bug 36080] New: Performance degradations when using large javascript files
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Mar 12 17:26:44 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=36080
Summary: Performance degradations when using large javascript
files
Product: WebKit
Version: 528+ (Nightly build)
Platform: PC
OS/Version: Windows XP
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: JavaScriptCore
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: david.leong at nokia.com
Created an attachment (id=50644)
--> (https://bugs.webkit.org/attachment.cgi?id=50644)
Test cases
We have noticed that using large javascript files results in a degradation in
performance.
Our use case contains a HTML page which uses with a large (>1meg) javascript
file. Performance of any javascript class/function in this file is much slower
than having the code split into smaller ~100k file chunks. On mobile devices we
have found that that up to 70% of the time when executing javascript is doing
character conversion and byteOrderMark checking.
After some investigation, we found that two problems:
1) WebCore::CachedScript::script() deletes decoded data with a timer callback
of 0s. If the script file is large this causes the data to be repeatedly
re-parsed many times when javascript core only wants small sections of the
code.
2) JSC::Lexer::setCode() is looking for the byteOrderMark for every character
that javascript core is interested in. For large script files this results in
many overlapping sections that have been checked before for the byte mark.
We've made a simple test page to reproduce the problem. The page is based on
the V8 benchmark with lots of text inserted as comments.
Here are some statistics from running v8 on my desktop to showcase the problem:
Tests done on a Core i7 920, 3gigs of ram, webkit trunk, running QGVLauncher
and repeated several times.
First, I ran the V8 test with no code changes.
Next, I added lots of text into the V8 test scripts
Finally, I disabled the byteOrderMark checking in JSC::Lexer and disabled the
script delete timer in WebCore::CachedScript to test the performance with the
workaround.
V8 baseline: V8 modified: V8 modified workaround:
Score: 977 806 975
Richards: 3314 2812 3279
DeltaBlue: 831 608 841
Crypto: 2211 1891 2238
RayTrace: 1193 993 1200
EarleyBoyer: 571 480 586
RegExp: 210 178 197
I am reworking the code to do a single pass BOM checking inside of
cachedScript. Also, I am thinking of adding a setting to change the timeout
before CachedScript class will delete the data.
Any feedback and comments would be apprecitated!
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list