From 2ef91243b52a14386afc1a20143cfdadd5c75478 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Tue, 10 Aug 2021 17:01:13 +0000 Subject: [PATCH] python: slow startup fix for all pyc files (unrelated: Also gets rid of static lib.) NOTE: Rebuild python-* packages (meson, ...) to get the fix. --- extra/python/build | 16 ++---- extra/python/checksums | 2 + extra/python/patches/python3-no-static.patch | 52 ++++++++++++++++++++ extra/python/patches/python3-pyc-hash.patch | 16 ++++++ extra/python/sources | 2 + 5 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 extra/python/patches/python3-no-static.patch create mode 100644 extra/python/patches/python3-pyc-hash.patch diff --git a/extra/python/build b/extra/python/build index 26f169a1..05baf42c 100755 --- a/extra/python/build +++ b/extra/python/build @@ -1,14 +1,5 @@ #!/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 <