Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4ad23a41c2ac
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7744bbcf777f
Choose a head ref
  • 5 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 19, 2016

  1. [Truffle] Run neural net.

    chrisseaton committed Jun 19, 2016
    Copy the full SHA
    6a83003 View commit details
  2. Copy the full SHA
    39b192f View commit details

Commits on Jun 20, 2016

  1. Copy the full SHA
    f750d99 View commit details
  2. Copy the full SHA
    c79f356 View commit details
  3. Copy the full SHA
    7744bbc View commit details
Showing with 86 additions and 8 deletions.
  1. +12 −1 ci.hocon
  2. +54 −2 mx.jruby/mx_jruby.py
  3. +20 −5 tool/jt.rb
13 changes: 12 additions & 1 deletion ci.hocon
Original file line number Diff line number Diff line change
@@ -176,6 +176,12 @@ psd-benchmarks: {
] ${post-process-and-upload-results}
}

micro-benchmarks: {
run: ${setup-benchmarks} [
[mx, benchmark, micro]
] ${post-process-and-upload-results}
}

builds: [
{name: ruby-test-fast} ${common} ${gate-caps} {run: [${jt} [test, fast]]},
{name: ruby-test-specs-command-line} ${common} ${gate-caps} {run: [${jt} [test, specs, ":command_line"]]},
@@ -213,5 +219,10 @@ builds: [
{name: ruby-benchmarks-psd-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${psd-benchmarks},
{name: ruby-benchmarks-psd-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${psd-benchmarks},
{name: ruby-benchmarks-psd-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${psd-benchmarks},
{name: ruby-benchmarks-psd-graalvm} ${common} ${graalvm} ${bench-caps} ${jruby-truffle} ${psd-benchmarks}
{name: ruby-benchmarks-psd-graalvm} ${common} ${graalvm} ${bench-caps} ${jruby-truffle} ${psd-benchmarks},

{name: ruby-benchmarks-micro-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${micro-benchmarks},
{name: ruby-benchmarks-micro-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${micro-benchmarks},
{name: ruby-benchmarks-micro-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${micro-benchmarks},
{name: ruby-benchmarks-micro-graalvm} ${common} ${graalvm} ${bench-caps} ${jruby-truffle} ${micro-benchmarks}
]
56 changes: 54 additions & 2 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -236,15 +236,25 @@ def time(self):
raise NotImplementedError()

def directory(self):
raise NotImplementedError()
return self.name()

def runBenchmark(self, benchmark, bmSuiteArgs):
arguments = ['benchmark']
if 'MX_BENCHMARK_OPTS' in os.environ:
arguments.extend(os.environ['MX_BENCHMARK_OPTS'].split(' '))
arguments.extend(['--simple'])
arguments.extend(['--time', str(self.time())])
arguments.extend([self.directory() + '/' + benchmark + '.rb'])
if ':' in benchmark:
benchmark_file, benchmark_name = benchmark.split(':')
benchmark_names = [benchmark_name]
else:
benchmark_file = benchmark
benchmark_names = []
if '.rb' in benchmark_file:
arguments.extend([benchmark_file])
else:
arguments.extend([self.directory() + '/' + benchmark_file + '.rb'])
arguments.extend(benchmark_names)
arguments.extend(bmSuiteArgs)
out = mx.OutputCapture()
jt(arguments, out=out)
@@ -272,6 +282,7 @@ def runBenchmark(self, benchmark, bmSuiteArgs):
'mandelbrot',
'matrix-multiply',
'n-body',
'neural-net',
'pidigits',
'red-black',
'richards',
@@ -372,9 +383,50 @@ def benchmarks(self):
def time(self):
return psd_benchmark_time

synthetic_benchmarks = [
'acid'
]

synthetic_benchmark_time = 120

class SyntheticBenchmarkSuite(AllBenchmarksBenchmarkSuite):
def name(self):
return 'synthetic'

def benchmarks(self):
return synthetic_benchmarks

def time(self):
return synthetic_benchmark_time

micro_benchmark_time = 30

class MicroBenchmarkSuite(AllBenchmarksBenchmarkSuite):
def name(self):
return 'micro'

def benchmarks(self):
out = mx.OutputCapture()
jt(['where', 'repos', 'all-ruby-benchmarks'], out=out)
all_ruby_benchmarks = out.data.strip()
benchmarks = []
for root, dirs, files in os.walk(os.path.join(all_ruby_benchmarks, 'micro')):
for name in files:
if name.endswith('.rb'):
benchmark_file = os.path.join(root, name)
out = mx.OutputCapture()
jt(['benchmark', 'list', benchmark_file], out=out)
benchmarks.extend([benchmark_file + ':' + b.strip() for b in out.data.split('\n') if len(b.strip()) > 0])
return benchmarks

def time(self):
return micro_benchmark_time

mx_benchmark.add_bm_suite(AllocationBenchmarkSuite())
mx_benchmark.add_bm_suite(MinHeapBenchmarkSuite())
mx_benchmark.add_bm_suite(TimeBenchmarkSuite())
mx_benchmark.add_bm_suite(ClassicBenchmarkSuite())
mx_benchmark.add_bm_suite(ChunkyBenchmarkSuite())
mx_benchmark.add_bm_suite(PSDBenchmarkSuite())
mx_benchmark.add_bm_suite(SyntheticBenchmarkSuite())
mx_benchmark.add_bm_suite(MicroBenchmarkSuite())
25 changes: 20 additions & 5 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -376,6 +376,7 @@ def help
puts ' note that to run most MRI benchmarks, you should translate them first with normal Ruby and cache the result, such as'
puts ' benchmark bench/mri/bm_vm1_not.rb --cache'
puts ' jt benchmark bench/mri/bm_vm1_not.rb --use-cache'
puts 'jt where repos ... find these repositories'
puts
puts 'you can also put build or rebuild in front of any command'
puts
@@ -945,19 +946,33 @@ def tarball(*options)
end

def benchmark(*args)
benchmark = args.pop
raise 'no benchmark given' unless benchmark
benchmark = Utilities.find_benchmark(benchmark)
raise 'benchmark not found' unless File.exist?(benchmark)
args.map! do |a|
if a.include?('.rb')
benchmark = Utilities.find_benchmark(a)
raise 'benchmark not found' unless File.exist?(benchmark)
benchmark
else
a
end
end

run_args = []
run_args.push '--graal' unless args.delete('--no-graal')
run_args.push '-I', "#{Utilities.find_gem('deep-bench')}/lib" rescue nil
run_args.push '-I', "#{Utilities.find_gem('benchmark-ips')}/lib" rescue nil
run_args.push "#{Utilities.find_gem('benchmark-interface')}/bin/benchmark"
run_args.push benchmark
run_args.push *args
run *run_args
end

def where(*args)
case args.shift
when 'repos'
args.each do |a|
puts Utilities.find_repo(a)
end
end
end

def check_ambiguous_arguments
ENV.delete "JRUBY_ECLIPSE" # never run from the Eclipse launcher here