From 42f4937f708dbac3b36d4eabfcb9fc8e3fa32f7a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 10 Aug 2021 16:00:58 +0000 Subject: [PATCH] python: fix slow startup time Closes #315 --- extra/python/build | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extra/python/build b/extra/python/build index c99a7d50..26f169a1 100755 --- a/extra/python/build +++ b/extra/python/build @@ -1,5 +1,14 @@ #!/bin/sh -e +# Without this environment variable being set to some arbitrary value, +# python's module loader uses timestamps for cache invalidation. Something +# goes wrong here and all pyc files are seen as stale. +# +# By setting this value, python uses checksums for cache invalidation which +# (on my machine) drops startup time from 3 seconds to 0.060s. Further +# investigation is needed. +export SOURCE_DATE_EPOCH=1628593994 + # Remove util-linux dependency among other things. cat >> Modules/Setup <