From 66c4dc15925bbcb1c31214a17a43d24d19890087 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Mon, 6 Mar 2023 22:36:57 -0800 Subject: [PATCH] Remove MJIT-specific benchmarks --- benchmark/lib/benchmark_driver/runner/mjit.rb | 34 ------------------- benchmark/mjit_exivar.yml | 18 ---------- benchmark/mjit_integer.yml | 32 ----------------- benchmark/mjit_kernel.yml | 20 ----------- benchmark/mjit_leave.yml | 8 ----- benchmark/mjit_opt_cc_insns.yml | 27 --------------- benchmark/mjit_struct_aref.yml | 10 ------ 7 files changed, 149 deletions(-) delete mode 100644 benchmark/lib/benchmark_driver/runner/mjit.rb delete mode 100644 benchmark/mjit_exivar.yml delete mode 100644 benchmark/mjit_integer.yml delete mode 100644 benchmark/mjit_kernel.yml delete mode 100644 benchmark/mjit_leave.yml delete mode 100644 benchmark/mjit_opt_cc_insns.yml delete mode 100644 benchmark/mjit_struct_aref.yml diff --git a/benchmark/lib/benchmark_driver/runner/mjit.rb b/benchmark/lib/benchmark_driver/runner/mjit.rb deleted file mode 100644 index 3a58a620de..0000000000 --- a/benchmark/lib/benchmark_driver/runner/mjit.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'benchmark_driver/struct' -require 'benchmark_driver/metric' -require 'erb' - -# A runner to measure after-JIT performance easily -class BenchmarkDriver::Runner::Mjit < BenchmarkDriver::Runner::Ips - # JobParser returns this, `BenchmarkDriver::Runner.runner_for` searches "*::Job" - Job = Class.new(BenchmarkDriver::DefaultJob) - - # Dynamically fetched and used by `BenchmarkDriver::JobParser.parse` - JobParser = BenchmarkDriver::DefaultJobParser.for(klass: Job, metrics: [METRIC]).extend(Module.new{ - def parse(**) - jobs = super - jobs.map do |job| - job = job.dup - job.prelude = "#{job.prelude}\n#{<<~EOS}" - if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? - __bmdv_ruby_i = 0 - while __bmdv_ruby_i < 10000 # MJIT call threshold - #{job.script} - __bmdv_ruby_i += 1 - end - RubyVM::MJIT.pause # compile - #{job.script} - RubyVM::MJIT.resume; RubyVM::MJIT.pause # recompile - #{job.script} - RubyVM::MJIT.resume; RubyVM::MJIT.pause # recompile 2 - end - EOS - job - end - end - }) -end diff --git a/benchmark/mjit_exivar.yml b/benchmark/mjit_exivar.yml deleted file mode 100644 index 2584fa6410..0000000000 --- a/benchmark/mjit_exivar.yml +++ /dev/null @@ -1,18 +0,0 @@ -type: lib/benchmark_driver/runner/mjit -prelude: | - class Bench < Hash - def initialize - @exivar = nil - end - - def exivar - @exivar - end - end - - bench = Bench.new - -benchmark: - mjit_exivar: bench.exivar - -loop_count: 200000000 diff --git a/benchmark/mjit_integer.yml b/benchmark/mjit_integer.yml deleted file mode 100644 index a6b5c9ee16..0000000000 --- a/benchmark/mjit_integer.yml +++ /dev/null @@ -1,32 +0,0 @@ -type: lib/benchmark_driver/runner/mjit -prelude: | - def mjit_abs(int) int.abs end - def mjit_bit_length(int) int.bit_length end - def mjit_comp(int) ~int end - def mjit_even?(int) int.even? end - def mjit_integer?(int) int.integer? end - def mjit_magnitude(int) int.magnitude end - def mjit_odd?(int) int.odd? end - def mjit_ord(int) int.ord end - def mjit_size(int) int.size end - def mjit_to_i(int) int.to_i end - def mjit_to_int(int) int.to_int end - def mjit_uminus(int) -int end - def mjit_zero?(int) int.zero? end - -benchmark: - - mjit_abs(-1) - - mjit_bit_length(100) - - mjit_comp(1) - - mjit_even?(2) - - mjit_integer?(0) - - mjit_magnitude(-1) - - mjit_odd?(1) - - mjit_ord(1) - - mjit_size(1) - - mjit_to_i(1) - - mjit_to_int(1) - - mjit_uminus(1) - - mjit_zero?(0) - -loop_count: 40000000 diff --git a/benchmark/mjit_kernel.yml b/benchmark/mjit_kernel.yml deleted file mode 100644 index 7720e65c2c..0000000000 --- a/benchmark/mjit_kernel.yml +++ /dev/null @@ -1,20 +0,0 @@ -type: lib/benchmark_driver/runner/mjit -prelude: | - def mjit_class(obj) - obj.class - end - - def mjit_frozen?(obj) - obj.frozen? - end - - str = "" - fstr = "".freeze - -benchmark: - - mjit_class(self) - - mjit_class(1) - - mjit_frozen?(str) - - mjit_frozen?(fstr) - -loop_count: 40000000 diff --git a/benchmark/mjit_leave.yml b/benchmark/mjit_leave.yml deleted file mode 100644 index 9ac68b164b..0000000000 --- a/benchmark/mjit_leave.yml +++ /dev/null @@ -1,8 +0,0 @@ -type: lib/benchmark_driver/runner/mjit -prelude: | - def leave - nil - end -benchmark: - mjit_leave: leave -loop_count: 200000000 diff --git a/benchmark/mjit_opt_cc_insns.yml b/benchmark/mjit_opt_cc_insns.yml deleted file mode 100644 index fed6d34bd5..0000000000 --- a/benchmark/mjit_opt_cc_insns.yml +++ /dev/null @@ -1,27 +0,0 @@ -# opt_* insns using vm_method_cfunc_is with send-compatible operands: -# * opt_nil_p -# * opt_not -# * opt_eq -type: lib/benchmark_driver/runner/mjit -prelude: | - def mjit_nil?(obj) - obj.nil? - end - - def mjit_not(obj) - !obj - end - - def mjit_eq(a, b) - a == b - end - -benchmark: - - script: mjit_nil?(1) - loop_count: 40000000 - - script: mjit_not(1) - loop_count: 40000000 - - script: mjit_eq(1, nil) - loop_count: 8000000 - - script: mjit_eq(nil, 1) - loop_count: 8000000 diff --git a/benchmark/mjit_struct_aref.yml b/benchmark/mjit_struct_aref.yml deleted file mode 100644 index bfba1323f2..0000000000 --- a/benchmark/mjit_struct_aref.yml +++ /dev/null @@ -1,10 +0,0 @@ -type: lib/benchmark_driver/runner/mjit -prelude: | - def mjit_struct_aref(struct) - struct.aa - end - struct = Struct.new(:a0, :a1, :a2, :a3, :a4, :a5, :a6, :a7, :a8, :a9, :aa).new - -benchmark: mjit_struct_aref(struct) - -loop_count: 40000000