bpo-45696: Deep-freeze selected modules (GH-29118)

This gains 10% or more in startup time for `python -c pass` on UNIX-ish systems.

The Makefile.pre.in generating code builds on Eric's work for bpo-45020, but the .c file generator is new.

Windows version TBD.
This commit is contained in:
Guido van Rossum 2021-11-10 18:01:53 -08:00 committed by GitHub
parent fc9b622819
commit 1cbaa505d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 808 additions and 56 deletions

View file

@ -32,6 +32,7 @@ struct _frozen {
const char *name; /* ASCII encoded string */
const unsigned char *code;
int size;
PyObject *(*get_code)(void);
};
/* Embedding apps may change this pointer to point to their favorite