Bug 16448

Summary: [GTK] Celtic Kane JavaScript performance on Array test is slow relative to Mac
Product: WebKit Reporter: Alp Toker <alp>
Component: JavaScriptCoreAssignee: Mark Rowe (bdash) <mrowe>
Status: RESOLVED FIXED    
Severity: Normal CC: mrowe
Priority: P2 Keywords: Gtk, Performance
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch mjs: review+

Alp Toker
Reported 2007-12-15 03:47:25 PST
The GTK+ port takes an unexpectedly high time on the Celtic Kane "Array object" benchmark: http://celtickane.com/webdesign/jsspeed2007.php wk 605ms fx2 264ms the DOM test is also suspiciously slow: wk 261ms fx2 179ms Probably something silly going on. We need to throw a profiler at this.
Attachments
Patch (6.11 KB, patch)
2007-12-16 14:34 PST, Mark Rowe (bdash)
mjs: review+
Mark Rowe (bdash)
Comment 1 2007-12-15 08:18:17 PST
Grr, I spent a little while this evening trying to find a profiler on Linux that would give me understandable data but failed miserably.
Mark Rowe (bdash)
Comment 2 2007-12-16 02:50:06 PST
Finally got gprof working. Most of the time looks to be spent inside toString in the comparison function below ArrayInstance::sort. I have a patch locally that tweaks ArrayInstance::sort to call toString O(N) times rather than O(N log N) times, which drop the Array test from 158 to 7ms on my Linux machine. I'm not entirely sure *why* toString was proving more expensive on Linux as gprof output isn't proving very enlightening. The patch is also a win on Mac (36 -> 6ms on Array).
Mark Rowe (bdash)
Comment 3 2007-12-16 14:19:42 PST
I'm not seeing the DOM test as being slow on my machine. It consistently takes around 25ms.
Mark Rowe (bdash)
Comment 4 2007-12-16 14:21:22 PST
I'm re-titling this bug for now to cover the Array aspect for which I have a patch. We should file separate bugs on other parts of the benchmark that are slower than expected.
Mark Rowe (bdash)
Comment 5 2007-12-16 14:34:46 PST
Maciej Stachowiak
Comment 6 2007-12-16 14:59:15 PST
Comment on attachment 17939 [details] Patch r=me
Maciej Stachowiak
Comment 7 2007-12-16 14:59:32 PST
(But I suggested an improvement to the comment)
Mark Rowe (bdash)
Comment 8 2007-12-16 17:15:09 PST
Landed in r28782.
Note You need to log in before you can comment on or make changes to this bug.