def with_host_vm(self, host_vm): return self.__class__(config_name=self._config_name, distributions=self._distributions, cp_suffix=self._cp_suffix, cp_prefix=self._cp_prefix, host_vm=host_vm, extra_vm_args=self._extra_vm_args, extra_polyglot_args=self._extra_polyglot_args) # ---------------------------------------------------------------------------------------------------------------------- # # the benchmark definition # # ---------------------------------------------------------------------------------------------------------------------- python_vm_registry = mx_benchmark.VmRegistry( PYTHON_VM_REGISTRY_NAME, known_host_registries=[java_vm_registry]) class PythonBenchmarkSuite(VmBenchmarkSuite, AveragingBenchmarkMixin): def __init__(self, name, bench_path, benchmarks, python_path=None): super(PythonBenchmarkSuite, self).__init__() self._name = name self._python_path = python_path self._harness_path = HARNESS_PATH self._harness_path = join(SUITE.dir, self._harness_path) if not self._harness_path: mx.abort("python harness path not specified!") self._bench_path, self._benchmarks = bench_path, benchmarks self._bench_path = join(SUITE.dir, self._bench_path)
out = mx.TeeOutputCapture(mx.OutputCapture()) code = host_vm.run_java(java_args + extra_polyglot_args + args, cwd=cwd, out=out, err=out) out = out.underlying.data dims = host_vm.dimensions(cwd, args, code, out) return code, out, dims def get_extra_polyglot_args(self): return ["--experimental-options", "--python.MaxNativeMemory=%s" % (2**34)] + self._extra_polyglot_args # ---------------------------------------------------------------------------------------------------------------------- # # the benchmark definition # # ---------------------------------------------------------------------------------------------------------------------- python_vm_registry = mx_benchmark.VmRegistry(PYTHON_VM_REGISTRY_NAME, known_host_registries=[java_vm_registry]) python_java_embedding_vm_registry = mx_benchmark.VmRegistry(PYTHON_JAVA_EMBEDDING_VM_REGISTRY_NAME, known_host_registries=[java_vm_registry]) class PythonBaseBenchmarkSuite(VmBenchmarkSuite, AveragingBenchmarkMixin): def __init__(self, name, benchmarks): super(PythonBaseBenchmarkSuite, self).__init__() self._name = name self._benchmarks = benchmarks self._graph_dump_time = None self._benchmarks_graphs = {} def has_graph_tags(self, benchmark): has_tag = False self._benchmarks_graphs[benchmark] = set() benchmark_path = join(self._bench_path, "{}.py".format(benchmark)) with open(benchmark_path, 'r') as fp:
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA # or visit www.oracle.com if you need additional information or have any # questions. # # ---------------------------------------------------------------------------------------------------- import pipes import mx, mx_benchmark import mx_sdk, mx_vm import os from os.path import dirname _suite = mx.suite('vm') _native_image_vm_registry = mx_benchmark.VmRegistry('NativeImage', 'ni-vm') _gu_vm_registry = mx_benchmark.VmRegistry('GraalUpdater', 'gu-vm') class GraalVm(mx_benchmark.OutputCapturingJavaVm): def __init__(self, name, config_name, extra_java_args, extra_launcher_args): """ :type name: str :type config_name: str :type extra_java_args: list[str] | None :type extra_launcher_args: list[str] | None """ super(GraalVm, self).__init__() self._name = name self._config_name = config_name self.extra_java_args = extra_java_args or [] self.extra_launcher_args = extra_launcher_args or []
primary=True, internal=True, importing_suite=None, load=False, vc=None, vc_dir='.') mx._primary_suite_init(_suite) # Ensure attribute existence for test # # mx_benchmark calls `mx.cpu_count`, which in turn calls `_opts.cpu_count`. # However, the attribute is only set from the `mx` entry point by the # argument parser. In unit tests, the attribute is thus missing. setattr(mx._opts, "cpu_count", None) _test_vm_registry = mx_benchmark.VmRegistry('TestBench', 'testbench-vm') benchmark_list = [ "a", "b", "bbb", "123", "hello-world", "A", "X-Y", "meta, tests" ] class TestBenchBenchmarkSuite(mx_benchmark.VmBenchmarkSuite): def group(self): return "mx" def subgroup(self): return "benchmarks" def name(self): return "benchSuite"