Bug 196764

Summary: Date.setDate is too slow in WKWebView
Product: WebKit Reporter: chenfeng <348018533>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: fpizlo, keith_miller, msaboff, saam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description chenfeng 2019-04-10 00:20:38 PDT
var sTime = Date.now();
var curTime = new Date();

for (var i = 0; i < 10000; i++) {
curTime.setDate(i);
}
console.log(Date.now() - sTime)



The execution time of the above code in different browsers:
Wkwebview: 16000ms
Safari: 120ms
Chrome: 3ms
Comment 1 Radar WebKit Bug Importer 2019-04-12 10:13:47 PDT
<rdar://problem/49854826>
Comment 2 Yusuke Suzuki 2021-02-01 02:34:16 PST
Now, Safari's perf is on per to Chrome.
Note: previously, JSC uses localtime_r. But this is super slow. Now we use ICU instead.

*** This bug has been marked as a duplicate of bug 218348 ***