[JSC] Allow JSBench to use precise time
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 00:40:09 +0000 (00:40 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2016 00:40:09 +0000 (00:40 +0000)
commitcdd6c62aa35a0dde10c6d100aa4849e4093b2c3a
treec3f04301c002bc032a8dd447fb209f43da9d44e7
parenta33458b3c9ee883818a3804a25cac159bf572697
[JSC] Allow JSBench to use precise time
https://bugs.webkit.org/show_bug.cgi?id=158050

Reviewed by Geoffrey Garen.

PerformanceTests:

* JSBench/amazon-chrome-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/amazon-chrome/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/amazon-firefox-win/urm.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/amazon-firefox/urm.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/amazon-safari/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/facebook-chrome-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/facebook-chrome/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/facebook-firefox-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/facebook-firefox/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/facebook-safari/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/google-chrome-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/google-chrome/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/google-firefox-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/google-firefox/uem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/google-safari/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/harness.js:
(runBenchmark.window.currentTimeInMS):
(runBenchmark.else.window.currentTimeInMS):
* JSBench/twitter-chrome-win/rem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/twitter-chrome/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/twitter-firefox-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/twitter-firefox/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/twitter-safari/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/yahoo-chrome-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/yahoo-chrome/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/yahoo-firefox-win/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/yahoo-firefox/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):
* JSBench/yahoo-safari/urem.js:
(else.window.performance.window.performance.now.currentTimeInMS):
(else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
(else.else.currentTimeInMS):
(onload.cb):
(onload):

Tools:

JSBench use `new Date().getTime()` without options and there is no way to use precise time.
This patch modifies the JSBench code to inject the code taking the precise time.
`currentTimeInMS` is given by the benchmerk harness and JSBench uses it.
run-jsc-benchmark switches this function's implementation between `Date.now()` and
testRunner's precise time one.

While this patch modifies the code of JSBench, the last release of JSBench is Jan 2013 and
the contents are not changed for a long time. As described in the original paper[1], the
tests can be generated by using JSBench's record & replay system, but in that case, we can
adopt this modification by changing the tool side.

We also add currentTimeInMS implementation in harness.js and u?rem.js directly.
u?rem.js implementation is required when it is executed in u?rem.html without harness.
And harness.js implementation is required when it is executed in the JSBench's harness.
In these implementation, we follow the JetStream's time measuring function: performance.now(),
preciseTime(), or Date.now().

[1]: http://dl.acm.org/citation.cfm?id=2048119

* Scripts/run-jsc-benchmarks:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@201442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
PerformanceTests/ChangeLog
PerformanceTests/JSBench/amazon-chrome-win/urem.js
PerformanceTests/JSBench/amazon-chrome/urem.js
PerformanceTests/JSBench/amazon-firefox-win/urm.js
PerformanceTests/JSBench/amazon-firefox/urm.js
PerformanceTests/JSBench/amazon-safari/urem.js
PerformanceTests/JSBench/facebook-chrome-win/urem.js
PerformanceTests/JSBench/facebook-chrome/urem.js
PerformanceTests/JSBench/facebook-firefox-win/urem.js
PerformanceTests/JSBench/facebook-firefox/urem.js
PerformanceTests/JSBench/facebook-safari/urem.js
PerformanceTests/JSBench/google-chrome-win/urem.js
PerformanceTests/JSBench/google-chrome/urem.js
PerformanceTests/JSBench/google-firefox-win/urem.js
PerformanceTests/JSBench/google-firefox/uem.js
PerformanceTests/JSBench/google-safari/urem.js
PerformanceTests/JSBench/harness.js
PerformanceTests/JSBench/twitter-chrome-win/rem.js
PerformanceTests/JSBench/twitter-chrome/urem.js
PerformanceTests/JSBench/twitter-firefox-win/urem.js
PerformanceTests/JSBench/twitter-firefox/urem.js
PerformanceTests/JSBench/twitter-safari/urem.js
PerformanceTests/JSBench/yahoo-chrome-win/urem.js
PerformanceTests/JSBench/yahoo-chrome/urem.js
PerformanceTests/JSBench/yahoo-firefox-win/urem.js
PerformanceTests/JSBench/yahoo-firefox/urem.js
PerformanceTests/JSBench/yahoo-safari/urem.js
Tools/ChangeLog
Tools/Scripts/run-jsc-benchmarks