[Webkit-unassigned] [Bug 146448] JavaScriptCore performance is very bad on Windows
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 16 11:11:51 PDT 2015
https://bugs.webkit.org/show_bug.cgi?id=146448
--- Comment #33 from peavo at outlook.com ---
Below is the MSVC implementation of _Thrd_current(), which is called by std::this_thread::get_id(). It's the DuplicateHandle() call which is time consuming according to the profiler. The code for _WIN32_WCE just calls GetCurrentThreadId(), which is faster. This is basically what we do with this patch.
_Thrd_t _Thrd_current(void)
{ /* return _Thrd_t identifying current thread */
_Thrd_t thr;
#ifdef _WIN32_WCE
thr._Hnd = (HANDLE)GetCurrentThreadId();
#elif defined(_CRT_APP) && !defined(_KERNELX)
thr._Hnd = (HANDLE)__crtGetCurrentWinRTThread();
#else /* _WIN32_WCE */
if (DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
GetCurrentProcess(), &thr._Hnd,
DUPLICATE_SAME_ACCESS, TRUE, 0))
CloseHandle(thr._Hnd);
else
thr._Hnd = 0;
#endif /* _WIN32_WCE */
#if defined(_CRT_APP) && !defined(_KERNELX)
thr._Id = __crtGetCurrentWinRTThreadId();
#else /* defined(_CRT_APP) && !defined(_KERNELX) */
thr._Id = GetCurrentThreadId();
#endif /* defined(_CRT_APP) && !defined(_KERNELX) */
return (thr);
}
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150716/9f653124/attachment-0001.html>
More information about the webkit-unassigned
mailing list