Skip to content

Commit e9369d3

Browse files
committed
[GR-40599] Add python community benchmarks
PullRequest: graalpython/2412
2 parents c758ee8 + c892297 commit e9369d3

File tree

10 files changed

+861
-2
lines changed

10 files changed

+861
-2
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "overlay": "4aed70dc8b809118c0856e2bafb9a2a1c002ef35" }
1+
{ "overlay": "6781591e5664dd8d3d4a16056c93960e0d1eb006" }
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
diff --git a/asv/benchmarks.py b/asv/benchmarks.py
2+
index 6411894..05f0678 100644
3+
--- a/asv/benchmarks.py
4+
+++ b/asv/benchmarks.py
5+
@@ -91,7 +91,7 @@ class Benchmarks(dict):
6+
"""
7+
Return a new Benchmarks object, with some benchmarks filtered out.
8+
"""
9+
- benchmarks = super(Benchmarks, self).__new__(self.__class__)
10+
+ benchmarks = self.__class__.__new__(self.__class__)
11+
benchmarks._conf = self._conf
12+
benchmarks._benchmark_dir = self._benchmark_dir
13+
benchmarks._all_benchmarks = self._all_benchmarks
14+
diff --git a/asv/util.py b/asv/util.py
15+
index 52eb96e..0a4d8ad 100644
16+
--- a/asv/util.py
17+
+++ b/asv/util.py
18+
@@ -44,7 +44,7 @@ if not WIN:
19+
from select import PIPE_BUF
20+
except ImportError:
21+
# PIPE_BUF is not available on Python 2.6
22+
- PIPE_BUF = os.pathconf('.', os.pathconf_names['PC_PIPE_BUF'])
23+
+ PIPE_BUF = 4096
24+
25+
26+
TIMEOUT_RETCODE = -256
27+
diff --git a/setup.py b/setup.py
28+
index b4c39ef..1aaef90 100755
29+
--- a/setup.py
30+
+++ b/setup.py
31+
@@ -79,6 +79,7 @@ basedir = os.path.abspath(os.path.dirname(__file__))
32+
33+
def get_version():
34+
"""Parse current version number from __init__.py"""
35+
+ return "0.5.1"
36+
# Grab the first assignment to __version__
37+
version = None
38+
init_py = os.path.join(os.path.dirname(__file__),

graalpython/lib-graalpython/patches/pip/whl/pip-20.1.1.patch

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/pyperformance/_pythoninfo.py b/pyperformance/_pythoninfo.py
2+
index 977b336..0e61573 100644
3+
--- a/pyperformance/_pythoninfo.py
4+
+++ b/pyperformance/_pythoninfo.py
5+
@@ -96,7 +96,7 @@ def _get_current_info():
6+
'executable (sys;realpath)': os.path.realpath(sys.executable),
7+
'prefix (sys)': sys.prefix,
8+
'exec_prefix (sys)': sys.exec_prefix,
9+
- 'stdlib_dir': os.path.dirname(os.__file__),
10+
+ 'stdlib_dir': os.path.dirname(json.__file__),
11+
'stdlib_dir (sys)': getattr(sys, '_stdlib_dir', None),
12+
'stdlib_dir (sysconfig)': (sysconfig.get_path('stdlib')
13+
if 'stdlib' in sysconfig.get_path_names()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
DISABLE_INSTALLABLES=true
2+
DYNAMIC_IMPORTS=/vm
23
NO_LICENSES=true

mx.graalpython/graalpython-launcher

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
DISABLE_INSTALLABLES=true
2-
DYNAMIC_IMPORTS=/substratevm
2+
DYNAMIC_IMPORTS=/vm,/substratevm
33
NATIVE_IMAGES=graalpy
44
NO_LICENSES=true

mx.graalpython/mx_graalpython.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
import mx_sdk
5656
import mx_subst
5757
import mx_graalpython_bisect
58+
import mx_graalpython_python_benchmarks
59+
5860
from mx_gate import Task
5961
from mx_graalpython_bench_param import PATH_MESO, BENCHMARKS, WARMUP_BENCHMARKS, JBENCHMARKS, PARSER_BENCHMARKS, \
6062
JAVA_DRIVER_BENCHMARKS
@@ -1364,6 +1366,7 @@ def update_import_cmd(args):
13641366

13651367
def python_style_checks(args):
13661368
"Check (and fix where possible) copyrights, eclipse formatting, and spotbugs"
1369+
python_run_mx_filetests(args)
13671370
python_checkcopyrights(["--fix"] if "--fix" in args else [])
13681371
if not os.environ.get("ECLIPSE_EXE"):
13691372
find_eclipse()
@@ -1397,6 +1400,13 @@ def python_checkcopyrights(args):
13971400
_python_checkpatchfiles()
13981401

13991402

1403+
def python_run_mx_filetests(args):
1404+
for test in glob.glob(os.path.join(os.path.dirname(__file__), "test_*.py")):
1405+
if not test.endswith("data.py"):
1406+
mx.log(test)
1407+
mx.run([sys.executable, test, "-v"])
1408+
1409+
14001410
def _python_checkpatchfiles():
14011411
listfilename = tempfile.mktemp()
14021412
# additionally, we want to check if the packages we are patching all have a permissive license
@@ -1763,6 +1773,8 @@ def mx_post_parse_cmd_line(namespace):
17631773
# all projects are now available at this time
17641774
_register_vms(namespace)
17651775
_register_bench_suites(namespace)
1776+
mx_graalpython_python_benchmarks.register_python_benchmarks()
1777+
17661778
for dist in mx.suite('graalpython').dists:
17671779
if hasattr(dist, 'set_archiveparticipant'):
17681780
dist.set_archiveparticipant(CharsetFilteringPariticpant())

0 commit comments

Comments
 (0)