diff options
author | Guido van Rossum <guido@python.org> | 2021-11-22 10:09:48 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 10:09:48 -0800 |
commit | 1037ca5a8ea001bfa2a198e08655620234e9befd (patch) | |
tree | dcf9b1966caca1eab0437f730f487701a960d851 /Tools/scripts/startuptime.py | |
parent | 4d6c0c0cce05befa06e0cad7351b1303ac048277 (diff) | |
download | cpython-git-1037ca5a8ea001bfa2a198e08655620234e9befd.tar.gz |
bpo-45850: Implement deep-freeze on Windows (#29648)
Implement changes to build with deep-frozen modules on Windows.
Note that we now require Python 3.10 as the "bootstrap" or "host" Python.
This causes a modest startup speed (around 7%) on Windows.
Diffstat (limited to 'Tools/scripts/startuptime.py')
-rw-r--r-- | Tools/scripts/startuptime.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Tools/scripts/startuptime.py b/Tools/scripts/startuptime.py new file mode 100644 index 0000000000..1bb5b208f6 --- /dev/null +++ b/Tools/scripts/startuptime.py @@ -0,0 +1,22 @@ +# Quick script to time startup for various binaries + +import subprocess +import sys +import time + +NREPS = 100 + + +def main(): + binaries = sys.argv[1:] + for bin in binaries: + t0 = time.time() + for _ in range(NREPS): + result = subprocess.run([bin, "-c", "pass"]) + result.check_returncode() + t1 = time.time() + print(f"{(t1-t0)/NREPS:6.3f} {bin}") + + +if __name__ == "__main__": + main() |