mirror of
https://github.com/python/cpython
synced 2024-10-06 15:49:57 +00:00
gh-97669: Remove Tools/scripts/startuptime.py (#98214)
The "pyperf command" tool be used instead. Example: $ python3 -m pyperf command -- python3 -c pass ..................... command: Mean +- std dev: 17.8 ms +- 0.4 ms pyperf also computes the standard deviation which gives an idea of the benchmark looks reliable or not.
This commit is contained in:
parent
342b1151ae
commit
d09d2c7c91
|
@ -1,22 +0,0 @@
|
|||
# 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()
|
Loading…
Reference in a new issue