[webkit-changes] [WebKit/WebKit] 37a6ff: Add performance object with now to JSC CLI

Keith Miller noreply at github.com
Mon Aug 19 11:02:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 37a6ff8b177984d11f4f6c82c3df4e898c7cfc4f
      https://github.com/WebKit/WebKit/commit/37a6ff8b177984d11f4f6c82c3df4e898c7cfc4f
  Author: Keith Miller <keith_miller at apple.com>
  Date:   2024-08-19 (Mon, 19 Aug 2024)

  Changed paths:
    M Source/JavaScriptCore/jsc.cpp
    M Source/WTF/wtf/Seconds.h
    M Source/WebCore/page/Performance.cpp

  Log Message:
  -----------
  Add performance object with now to JSC CLI
https://bugs.webkit.org/show_bug.cgi?id=277811
rdar://133472694

Reviewed by Yijia Huang.

We want this to be as close as possible to what WebCore does when using
a high resolution timer (as we expect JetStream to do). This gives us
more accurate numbers.

One kinda weird thing is that the first time we call `performance.now()`
in the CLI it will return 0 since we're also initializing our timeOrigin
at that time. It's not even clear we need a timeOrigin since any benchmark
is likely going to do `end - start` anyway so the timeOrigin would cancel
out but maybe some FP rounding issues would show up that way.

* Source/JavaScriptCore/jsc.cpp:
(JSC_DEFINE_HOST_FUNCTION):
* Source/WTF/wtf/Seconds.h:
* Source/WebCore/page/Performance.cpp:
(WebCore::Performance::reduceTimeResolution):
(WebCore::Performance::allowHighPrecisionTime):

Canonical link: https://commits.webkit.org/282438@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list