summaryrefslogtreecommitdiff
path: root/deps/v8/test/benchmarks
diff options
context:
space:
mode:
authorRefael Ackermann <refack@gmail.com>2019-05-28 08:46:21 -0400
committerRefael Ackermann <refack@gmail.com>2019-06-01 09:55:12 -0400
commited74896b1fae1c163b3906163f3bf46326618ddb (patch)
tree7fb05c5a19808e0c5cd95837528e9005999cf540 /deps/v8/test/benchmarks
parent2a850cd0664a4eee51f44d0bb8c2f7a3fe444154 (diff)
downloadnode-new-ed74896b1fae1c163b3906163f3bf46326618ddb.tar.gz
deps: update V8 to 7.5.288.22
PR-URL: https://github.com/nodejs/node/pull/27375 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'deps/v8/test/benchmarks')
-rwxr-xr-xdeps/v8/test/benchmarks/csuite/benchmark.py21
-rwxr-xr-xdeps/v8/test/benchmarks/csuite/compare-baseline.py3
-rwxr-xr-xdeps/v8/test/benchmarks/csuite/csuite.py43
3 files changed, 38 insertions, 29 deletions
diff --git a/deps/v8/test/benchmarks/csuite/benchmark.py b/deps/v8/test/benchmarks/csuite/benchmark.py
index fee08c8157..5d6fd0a670 100755
--- a/deps/v8/test/benchmarks/csuite/benchmark.py
+++ b/deps/v8/test/benchmarks/csuite/benchmark.py
@@ -8,6 +8,9 @@ Local benchmark runner.
The -c option is mandatory.
'''
+# for py2/py3 compatibility
+from __future__ import print_function
+
import math
from optparse import OptionParser
import os
@@ -96,7 +99,7 @@ class BenchmarkSuite(object):
elif self.name in self.kGeometricScoreSuites:
self.ComputeScoreV8Octane(self.name)
else:
- print "Don't know how to compute score for suite: '%s'" % self.name
+ print("Don't know how to compute score for suite: '%s'" % self.name)
def IsBetterThan(self, other):
if self.name in self.kClassicScoreSuites:
@@ -104,7 +107,7 @@ class BenchmarkSuite(object):
elif self.name in self.kGeometricScoreSuites:
return self.score > other.score
else:
- print "Don't know how to compare score for suite: '%s'" % self.name
+ print("Don't know how to compare score for suite: '%s'" % self.name)
class BenchmarkRunner(object):
@@ -140,7 +143,7 @@ class BenchmarkRunner(object):
outfile = "%s/out.%d.txt" % (self.outdir, i)
if os.path.exists(outfile) and not self.opts.force:
continue
- print "run #%d" % i
+ print("run #%d" % i)
cmdline = "%s > %s" % (self.opts.command, outfile)
subprocess.call(cmdline, shell=True)
time.sleep(self.opts.sleep)
@@ -179,11 +182,11 @@ class BenchmarkRunner(object):
suite.ProcessResults(self.opts)
suite.ComputeScore()
- print ("%s,%.1f,%.2f,%d " %
- (suite.name, suite.score, suite.sigma, suite.num)),
+ print(("%s,%.1f,%.2f,%d " %
+ (suite.name, suite.score, suite.sigma, suite.num)), end='')
if self.opts.verbose:
- print ""
- print ""
+ print("")
+ print("")
if __name__ == '__main__':
@@ -206,14 +209,14 @@ if __name__ == '__main__':
opts.sleep = int(opts.sleep)
if not opts.command:
- print "You must specify the command to run (-c). Aborting."
+ print("You must specify the command to run (-c). Aborting.")
sys.exit(1)
cachedir = os.path.abspath(os.getcwd())
if not opts.cachedir:
opts.cachedir = cachedir
if not os.path.exists(opts.cachedir):
- print "Directory " + opts.cachedir + " is not valid. Aborting."
+ print("Directory " + opts.cachedir + " is not valid. Aborting.")
sys.exit(1)
br = BenchmarkRunner(args, os.getcwd(), opts)
diff --git a/deps/v8/test/benchmarks/csuite/compare-baseline.py b/deps/v8/test/benchmarks/csuite/compare-baseline.py
index 36ebd2cf0e..ec4bfe467d 100755
--- a/deps/v8/test/benchmarks/csuite/compare-baseline.py
+++ b/deps/v8/test/benchmarks/csuite/compare-baseline.py
@@ -10,6 +10,9 @@ runner directly into this script or specify the results file with
the -f option.
'''
+# for py2/py3 compatibility
+from __future__ import print_function
+
import csv
import math
from optparse import OptionParser
diff --git a/deps/v8/test/benchmarks/csuite/csuite.py b/deps/v8/test/benchmarks/csuite/csuite.py
index 25b447efb8..ce2ad84384 100755
--- a/deps/v8/test/benchmarks/csuite/csuite.py
+++ b/deps/v8/test/benchmarks/csuite/csuite.py
@@ -31,6 +31,9 @@ You can run from any place:
../../somewhere-strange/csuite.py sunspider compare ./d8-better
'''
+# for py2/py3 compatibility
+from __future__ import print_function
+
import os
from optparse import OptionParser
import subprocess
@@ -47,48 +50,48 @@ if __name__ == '__main__':
(opts, args) = parser.parse_args()
if len(args) < 3:
- print 'not enough arguments'
+ print('not enough arguments')
sys.exit(1)
suite = args[0]
mode = args[1]
if suite not in ['octane', 'sunspider', 'kraken']:
- print 'Suite must be octane, sunspider or kraken. Aborting.'
+ print('Suite must be octane, sunspider or kraken. Aborting.')
sys.exit(1)
if mode != 'baseline' and mode != 'compare':
- print 'mode must be baseline or compare. Aborting.'
+ print('mode must be baseline or compare. Aborting.')
sys.exit(1)
# Set up paths.
d8_path = os.path.abspath(args[2])
if not os.path.exists(d8_path):
- print d8_path + " is not valid."
+ print(d8_path + " is not valid.")
sys.exit(1)
csuite_path = os.path.dirname(os.path.abspath(__file__))
if not os.path.exists(csuite_path):
- print "The csuite directory is invalid."
+ print("The csuite directory is invalid.")
sys.exit(1)
benchmark_py_path = os.path.join(csuite_path, "benchmark.py")
if not os.path.exists(benchmark_py_path):
- print "Unable to find benchmark.py in " + output_path_base \
- + ". Aborting."
+ print("Unable to find benchmark.py in " + csuite_path \
+ + ". Aborting.")
sys.exit(1)
compare_baseline_py_path = os.path.join(csuite_path,
"compare-baseline.py")
if not os.path.exists(compare_baseline_py_path):
- print "Unable to find compare-baseline.py in " + output_path_base \
- + ". Aborting."
+ print("Unable to find compare-baseline.py in " + csuite_path \
+ + ". Aborting.")
sys.exit(1)
benchmark_path = os.path.abspath(os.path.join(csuite_path, "../data"))
if not os.path.exists(benchmark_path):
- print "I can't find the benchmark data directory. Aborting."
+ print("I can't find the benchmark data directory. Aborting.")
sys.exit(1)
# Gather the remaining arguments into a string of extra args for d8.
@@ -111,12 +114,12 @@ if __name__ == '__main__':
if opts.runs:
if (float(opts.runs) / runs) < 0.6:
- print "Normally, %s requires %d runs to get stable results." \
- % (suite, runs)
+ print("Normally, %s requires %d runs to get stable results." \
+ % (suite, runs))
runs = int(opts.runs)
if opts.verbose:
- print "Running and averaging %s %d times." % (suite, runs)
+ print("Running and averaging %s %d times." % (suite, runs))
# Ensure output directory is setup
output_path_base = os.path.abspath(os.getcwd())
@@ -124,16 +127,16 @@ if __name__ == '__main__':
output_file = os.path.join(output_path, "master")
if not os.path.exists(output_path):
if opts.verbose:
- print "Creating directory %s." % output_path
+ print("Creating directory %s." % output_path)
os.mkdir(output_path)
if opts.verbose:
- print "Working directory for runs is %s." % suite_path
+ print("Working directory for runs is %s." % suite_path)
inner_command = " -c \"%s --expose-gc %s %s \"" \
% (d8_path, extra_args, cmd)
if opts.verbose:
- print "calling d8 like so: %s." % inner_command
+ print("calling d8 like so: %s." % inner_command)
cmdline_base = "python %s %s -fv -r %d -d %s" \
% (benchmark_py_path, inner_command, runs, output_path_base)
@@ -145,10 +148,10 @@ if __name__ == '__main__':
% (cmdline_base, compare_baseline_py_path, output_file)
if opts.verbose:
- print "Spawning subprocess: %s." % cmdline
+ print("Spawning subprocess: %s." % cmdline)
return_code = subprocess.call(cmdline, shell=True, cwd=suite_path)
if return_code < 0:
- print "Error return code: %d." % return_code
+ print("Error return code: %d." % return_code)
if mode == "baseline":
- print "Wrote %s." % output_file
- print "Run %s again with compare mode to see results." % suite
+ print("Wrote %s." % output_file)
+ print("Run %s again with compare mode to see results." % suite)