Skip to content

Commit b0ba6f9

Browse files
committed
gzip the pgo profile
1 parent 12cd10f commit b0ba6f9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
"linux:amd64:jdk-latest" : weekly + t("01:30:00") + task_spec({
235235
run: [["mx", "python-native-pgo"]],
236236
logs+: [
237-
"default.iprof",
237+
"default.iprof.gz",
238238
"default.lcov",
239239
],
240240
}),

mx.graalpython/mx_graalpython.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import datetime
2929
import fnmatch
3030
import glob
31+
import gzip
3132
import itertools
3233
import os
3334
import pathlib
@@ -47,9 +48,6 @@
4748
import mx_graalpython_benchmark
4849
import mx_urlrewrites
4950

50-
if sys.version_info[0] < 3:
51-
raise RuntimeError("The build scripts are no longer compatible with Python 2")
52-
5351
import tempfile
5452
from argparse import ArgumentParser
5553
from dataclasses import dataclass
@@ -365,6 +363,11 @@ def graalpy_native_pgo_build_and_test(_):
365363

366364
mx.log(mx.colorize(f"[PGO] Optimized PGO build complete: {native_bin}", color="yellow"))
367365

366+
iprof_gz_path = str(iprof_path) + '.gz'
367+
with open(iprof_path, 'rb') as f_in, gzip.open(iprof_gz_path, 'wb') as f_out:
368+
shutil.copyfileobj(f_in, f_out)
369+
mx.log(mx.colorize(f"[PGO] Gzipped profile at: {iprof_gz_path}", color="yellow"))
370+
368371

369372
def full_python(args, env=None):
370373
"""Run python from standalone build (unless kwargs are given). Does not build GraalPython sources automatically."""

0 commit comments

Comments
 (0)