mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Experiment with making Python go faster
The goal is to put the compiled pyc files in the APE ZIP.
This commit is contained in:
parent
4486ad5c9e
commit
ebb8c85496
33 changed files with 9483 additions and 1859 deletions
3
third_party/python/Python/codecs.c
vendored
3
third_party/python/Python/codecs.c
vendored
|
@ -1556,6 +1556,9 @@ static int _PyCodecRegistry_Init(void)
|
|||
interp->codec_error_registry == NULL)
|
||||
Py_FatalError("can't initialize codec registry");
|
||||
|
||||
/*
|
||||
* XXX: terrible design!
|
||||
*/
|
||||
mod = PyImport_ImportModuleNoBlock("encodings");
|
||||
if (mod == NULL) {
|
||||
return -1;
|
||||
|
|
5
third_party/python/Python/import.c
vendored
5
third_party/python/Python/import.c
vendored
|
@ -40,11 +40,6 @@
|
|||
/* See _PyImport_FixupExtensionObject() below */
|
||||
static PyObject *extensions = NULL;
|
||||
|
||||
/* This table is defined in config.c: */
|
||||
extern struct _inittab _PyImport_Inittab[];
|
||||
|
||||
struct _inittab *PyImport_Inittab = _PyImport_Inittab;
|
||||
|
||||
static PyObject *initstr = NULL;
|
||||
|
||||
/*[clinic input]
|
||||
|
|
7
third_party/python/Python/importlib.inc
vendored
7
third_party/python/Python/importlib.inc
vendored
|
@ -6,7 +6,12 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
/* clang-format off */
|
||||
|
||||
/* Auto-generated by Programs/_freeze_importlib.c */
|
||||
/*
|
||||
* Auto-generated by
|
||||
* m/third_party/python/freeze.com \
|
||||
* third_party/python/Lib/importlib/_bootstrap.py \
|
||||
* third_party/python/Python/importlib.inc
|
||||
*/
|
||||
|
||||
const unsigned char _Py_M__importlib[] = {
|
||||
99,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,
|
||||
|
|
|
@ -6,7 +6,12 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
/* clang-format off */
|
||||
|
||||
/* Auto-generated by Programs/_freeze_importlib.c */
|
||||
/*
|
||||
* Auto-generated by
|
||||
* m/third_party/python/freeze.com \
|
||||
* third_party/python/Lib/importlib/_bootstrap_external.py \
|
||||
* third_party/python/Python/importlib_external.inc
|
||||
*/
|
||||
|
||||
const unsigned char _Py_M__importlib_external[] = {
|
||||
99,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,
|
||||
|
|
3
third_party/python/Python/pylifecycle.c
vendored
3
third_party/python/Python/pylifecycle.c
vendored
|
@ -305,7 +305,8 @@ import_init(PyInterpreterState *interp, PyObject *sysmod)
|
|||
Py_DECREF(value);
|
||||
Py_DECREF(impmod);
|
||||
|
||||
_PyImportZip_Init();
|
||||
/* just add zip!.python/ to sys.path */
|
||||
/* _PyImportZip_Init(); */
|
||||
}
|
||||
|
||||
|
||||
|
|
2
third_party/python/Python/pythonrun.c
vendored
2
third_party/python/Python/pythonrun.c
vendored
|
@ -4,6 +4,7 @@
|
|||
│ Python 3 │
|
||||
│ https://docs.python.org/3/license.html │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/unicode/locale.h"
|
||||
#include "third_party/python/Include/Python-ast.h"
|
||||
#include "third_party/python/Include/abstract.h"
|
||||
|
@ -26,6 +27,7 @@
|
|||
#include "third_party/python/Include/pydebug.h"
|
||||
#include "third_party/python/Include/pyerrors.h"
|
||||
#include "third_party/python/Include/pylifecycle.h"
|
||||
#include "third_party/python/Include/pythonrun.h"
|
||||
#include "third_party/python/Include/setobject.h"
|
||||
#include "third_party/python/Include/symtable.h"
|
||||
#include "third_party/python/Include/sysmodule.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue