55$env: PYTHONPROFILEIMPORTTIME = $null
66$env: PYTHONDONTWRITEBYTECODE = 1
77
8- Remove-Item - Recurse " build\perftest"
9- Remove-Item perf.*
8+ Remove-Item - Recurse " build\perftest" | Out-Null
9+ Remove-Item perf.* | Out-Null
1010python assets/ generate- perftest- directory.py
1111
12+ # Note the size of the source code tree.
13+ Write-Output " Source tree" > perf.files.log
14+ Get-ChildItem - Recurse " build\perftest" | Measure-Object - Sum Length >> perf.files.log
15+
16+
1217$env: PYTHONPROFILEIMPORTTIME = 1
18+ $env: PYTHONDONTWRITEBYTECODE = 1
1319
1420
1521# Filesystem -- source only
@@ -57,7 +63,17 @@ Measure-Command {
5763# ------------------------------
5864
5965$env: PYTHONPROFILEIMPORTTIME = $null
66+
67+ # Compile into `__pycache__/` subdirectories for the filesystem.
6068python - m compileall - q " build\perftest"
69+
70+ # Note the size of the tree, including bytecode.
71+ Write-Output " Source tree with bytecode" >> perf.files.log
72+ Get-ChildItem - Recurse " build\perftest" | Measure-Object - Sum Length >> perf.files.log
73+
74+ # Compile in-place for zipimport.
75+ python - m compileall - b - q " build\perftest"
76+
6177$env: PYTHONPROFILEIMPORTTIME = 1
6278
6379
@@ -76,6 +92,10 @@ Measure-Command {
7692# Zip -- bytecode
7793# ---------------
7894
95+ # Delete the `__pycache__\` directories.
96+ $cache_paths = Get-ChildItem - Recurse " build\perftest" | Where-Object { $_.Name -eq " __pycache__" }
97+ Remove-Item - Recurse $cache_paths | Out-Null
98+
7999Write-Host
80100$env: FILE_PREFIX = " perf.zip.bytecode"
81101Write-Host " ${env: FILE_PREFIX} "
@@ -105,4 +125,4 @@ Measure-Command {
105125# Capture the file sizes
106126# ----------------------
107127
108- Get-ChildItem perf.* > perf.files.log
128+ Get-ChildItem perf.* .zip , perf. * .sqlite3 > > perf.files.log
0 commit comments