Open peakschris opened 1 week ago
I am wondering if bazelbuild/bazel#22865 is related. Could you please try if nondblzmod is the same overhead?
Could you also check if precompiling py files to pyc helps (that is a new feature in 0.32.2)?
Other than that, #1653 could be also related.
Ah, good thought! https://github.com/bazelbuild/bazel/issues/22865 was opened by me, so I have the fix. Sadly the fixed bazel doesn't resolve this - launch time still 5+s
Just to confirm that I have the fix, here are the files in my external dir:
I don't think that #1653 is related because I am using system interpreter, and I have disabled legacy_external_runfiles
I can't understand from the docs what I should change in my py_binary target to enable precompiling. Could you advise?
Thanks, Chris
Ok, I updated from 0.32.2 to 0.33.2, and the precompiling option started working. But unfortunately no improvement in speed:
INFO: Elapsed time: 0.377s
bazel run //:myscript --@rules_python//python/config_settings:precompile=enabled -- --help
command took 5.61s
Another datapoint: Using 7z to recursively extract the zip created by py_binary takes 0.64s
What is the performance if you launch the the script directly? I.e. bazel build
+ executing it instead of bazel run
?
On windows, with rules_python as module and system interpreter and a simple script:
Due to the 10x overhead, for such a regularly run tool, users are refusing to run via bazel. I'm guessing the overhead is unzipping, but am not sure. We would prefer to run without zipping if zipping has a 10x overhead.
Full output from bazel run:
Relevant options:
.bazelrc
Module.bazel
🐞 bug report
Affected Rule
py_binary
Is this a regression?
No
🔬 Minimal Reproduction
I can create this if it would help
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?