@@ -9,6 +9,11 @@ rm -rf "build/perftest" || true
99rm perf.* || true
1010python assets/generate-perftest-directory.py
1111
12+ # Note the size of the source code tree.
13+ echo " Source tree" > perf.files.log
14+ du --max-depth=0 --bytes build/perftest >> perf.files.log
15+
16+
1217export PYTHONPROFILEIMPORTTIME=1
1318export PYTHONDONTWRITEBYTECODE=1
1419
@@ -53,8 +58,16 @@ command time --portability --output "${FILE_PREFIX}.time.log" \
5358# Compile the source to bytecode
5459# ------------------------------
5560
61+ # Compile into `__pycache__/` subdirectories for the filesystem.
5662PYTHONPROFILEIMPORTTIME=" " python -m compileall -q " build/perftest"
5763
64+ # Note the size of the tree, including bytecode.
65+ echo " Source tree with bytecode" >> perf.files.log
66+ du --max-depth=0 --bytes build/perftest >> perf.files.log
67+
68+ # Compile in-place for zipimport.
69+ PYTHONPROFILEIMPORTTIME=" " python -m compileall -b -q " build/perftest"
70+
5871
5972# Filesystem -- bytecode
6073# ----------------------
@@ -75,7 +88,7 @@ export FILE_PREFIX="perf.zip.bytecode"
7588echo " ${FILE_PREFIX} "
7689export PYTHONPATH=" ${FILE_PREFIX} .zip"
7790cd " build/perftest"
78- zip -qr9 " ../../${PYTHONPATH} " .
91+ zip -qr9 " ../../${PYTHONPATH} " . --exclude ' */__pycache__/* '
7992cd " ../.."
8093command time --portability --output " ${FILE_PREFIX} .time.log" \
8194 python -c ' import a; print(a)' 2> " ${FILE_PREFIX} .import.log"
@@ -97,4 +110,4 @@ command time --portability --output "${FILE_PREFIX}.time.log" \
97110# Capture the file sizes
98111# ----------------------
99112
100- ls -l perf.* > perf.files.log
113+ ls -l perf.* .zip perf. * .sqlite3 > > perf.files.log
0 commit comments