Bug 144676

Summary: Don't allocate a StringImpl for every Number JSValue in JSON.stringify().
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue, ggaren, kling, msaboff
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch darin: review+

Andreas Kling
Reported 2015-05-06 00:53:46 PDT
We can do a lot better on Kraken/json-stringify-tinderbox! For example: json-stringify-tinderbox 63.370+-3.319 ^ 56.031+-3.150 ^ definitely 1.1310x faster
Attachments
Patch (1.90 KB, patch)
2015-05-06 00:54 PDT, Andreas Kling
no flags
Patch (1.88 KB, patch)
2015-05-06 01:39 PDT, Andreas Kling
darin: review+
Andreas Kling
Comment 1 2015-05-06 00:54:46 PDT
WebKit Commit Bot
Comment 2 2015-05-06 00:56:32 PDT
Attachment 252461 [details] did not pass style-queue: ERROR: Source/JavaScriptCore/runtime/JSONObject.cpp:41: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 3 2015-05-06 01:39:05 PDT
Darin Adler
Comment 4 2015-05-06 09:23:09 PDT
Comment on attachment 252462 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=252462&action=review > Source/JavaScriptCore/runtime/JSONObject.cpp:399 > + NumberToStringBuffer buffer; > + builder.append(numberToString(number, buffer)); StringBuilder has a function named appendECMAScriptNumber. I suggest you use that instead, which would make your patch even smaller.
Andreas Kling
Comment 5 2015-05-06 10:12:05 PDT
Note You need to log in before you can comment on or make changes to this bug.