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: c4ddcb383269
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dc37747276dd
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 13, 2016

  1. Copy the full SHA
    90f0bc5 View commit details
  2. Copy the full SHA
    dc37747 View commit details
Showing with 49 additions and 27 deletions.
  1. +49 −20 mx.jruby/mx_jruby.py
  2. +0 −7 truffle/src/main/java/org/jruby/truffle/language/arguments/ReadBlockNode.java
69 changes: 49 additions & 20 deletions mx.jruby/mx_jruby.py
Original file line number Diff line number Diff line change
@@ -377,32 +377,61 @@ def runBenchmark(self, benchmark, bmSuiteArgs):
out = mx.OutputCapture()

if jt(arguments, out=out, nonZeroIsFatal=False) == 0:
data = [float(s) for s in out.data.split('\n')[1:-1]]
elapsed = [d for n, d in enumerate(data) if n % 2 == 0]
samples = [d for n, d in enumerate(data) if n % 2 == 1]
lines = out.data.split('\n')[1:-1]

if len(samples) > 1:
warmed_up_samples = [sample for n, sample in enumerate(samples) if n / float(len(samples)) >= 0.5]
if lines[-1] == 'optimised away':
data = [float(s) for s in lines[0:-2]]
elapsed = [d for n, d in enumerate(data) if n % 2 == 0]
samples = [d for n, d in enumerate(data) if n % 2 == 1]

return [{
'benchmark': benchmark,
'metric.name': 'throughput',
'metric.value': sample,
'metric.unit': 'op/s',
'metric.better': 'higher',
'metric.iteration': n,
'extra.metric.warmedup': 'false',
'extra.metric.elapsed-num': e,
'extra.metric.human': 'optimised away'
} for n, (e, sample) in enumerate(zip(elapsed, samples))] + [{
'benchmark': benchmark,
'metric.name': 'throughput',
'metric.value': 2147483647, # arbitrary high value (--simple won't run more than this many ips)
'metric.unit': 'op/s',
'metric.better': 'higher',
'metric.iteration': len(samples),
'extra.metric.warmedup': 'true',
'extra.metric.elapsed-num': elapsed[-1] + 2.0, # just put the data point beyond the last one a bit
'extra.metric.human': 'optimised away',
'extra.error': 'optimised away'
}]
else:
warmed_up_samples = samples
data = [float(s) for s in lines]
elapsed = [d for n, d in enumerate(data) if n % 2 == 0]
samples = [d for n, d in enumerate(data) if n % 2 == 1]

warmed_up_mean = sum(warmed_up_samples) / float(len(warmed_up_samples))

return [{
'benchmark': benchmark,
'metric.name': 'throughput',
'metric.value': sample,
'metric.unit': 'op/s',
'metric.better': 'higher',
'metric.iteration': n,
'extra.metric.warmedup': 'true' if n / float(len(samples)) >= 0.5 else 'false',
'extra.metric.elapsed-num': e,
'extra.metric.human': '%d/%d %f op/s' % (n, len(samples), warmed_up_mean)
} for n, (e, sample) in enumerate(zip(elapsed, samples))]
if len(samples) > 1:
warmed_up_samples = [sample for n, sample in enumerate(samples) if n / float(len(samples)) >= 0.5]
else:
warmed_up_samples = samples

warmed_up_mean = sum(warmed_up_samples) / float(len(warmed_up_samples))

return [{
'benchmark': benchmark,
'metric.name': 'throughput',
'metric.value': sample,
'metric.unit': 'op/s',
'metric.better': 'higher',
'metric.iteration': n,
'extra.metric.warmedup': 'true' if n / float(len(samples)) >= 0.5 else 'false',
'extra.metric.elapsed-num': e,
'extra.metric.human': '%d/%d %f op/s' % (n, len(samples), warmed_up_mean)
} for n, (e, sample) in enumerate(zip(elapsed, samples))]
else:
sys.stderr.write(out.data)

# TODO CS 24-Jun-16, how can we fail the wider suite?
return [{
'benchmark': benchmark,
'metric.name': 'throughput',
Original file line number Diff line number Diff line change
@@ -9,11 +9,9 @@
*/
package org.jruby.truffle.language.arguments;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.profiles.ConditionProfile;
import org.jruby.truffle.Layouts;
import org.jruby.truffle.language.RubyNode;

public class ReadBlockNode extends RubyNode {
@@ -33,11 +31,6 @@ public Object execute(VirtualFrame frame) {
if (blockProfile.profile(block == null)) {
return valueIfAbsent;
} else {
if (!Layouts.PROC.isProc(block)) {
CompilerDirectives.transferToInterpreter();
throw new UnsupportedOperationException("Block isn't an instance of Proc");
}

return block;
}
}