Add speedups from pyston (#264)

This should make Python go 30% faster. It does that by trading
away some debuggability, like _tracemalloc. It can be re-enabled
using `make MODE=dbg`.
This commit is contained in:
Gautham 2021-09-04 14:51:37 +05:30 committed by GitHub
parent 31dd714081
commit 27f7ffd4fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 175 additions and 12 deletions

View file

@ -1794,7 +1794,7 @@ _PyTraceMalloc_Fini(void)
}
int
_PyTraceMalloc_Track(_PyTraceMalloc_domain_t domain, uintptr_t ptr,
(_PyTraceMalloc_Track)(_PyTraceMalloc_domain_t domain, uintptr_t ptr,
size_t size)
{
int res;
@ -1823,7 +1823,7 @@ _PyTraceMalloc_Track(_PyTraceMalloc_domain_t domain, uintptr_t ptr,
int
_PyTraceMalloc_Untrack(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
(_PyTraceMalloc_Untrack)(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
{
if (!tracemalloc_config.tracing) {
/* tracemalloc is not tracing: do nothing */
@ -1839,7 +1839,7 @@ _PyTraceMalloc_Untrack(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
PyObject*
_PyTraceMalloc_GetTraceback(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
(_PyTraceMalloc_GetTraceback)(_PyTraceMalloc_domain_t domain, uintptr_t ptr)
{
traceback_t *traceback;

View file

@ -27,6 +27,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#include "third_party/python/Include/pyport.h"
#include "third_party/python/Include/pyport.h"
#include "third_party/python/Include/Python.h"
#include "third_party/python/Include/cosmo.h"
PyObject* PyInit__decimal(void);
PyObject* PyInit_audioop(void);
@ -47,7 +48,9 @@ PyObject* PyInit__locale(void);
PyObject* PyInit__io(void);
PyObject* PyInit_zipimport(void);
PyObject* PyInit_faulthandler(void);
#ifdef MODE_DBG
PyObject* PyInit__tracemalloc(void);
#endif
PyObject* PyInit__symtable(void);
PyObject* PyInit_array(void);
PyObject* PyInit_cmath(void);
@ -99,6 +102,7 @@ PyObject *PyInit__sqlite3(void);
PyObject* PyMarshal_Init(void);
PyObject* PyInit_imp(void);
PyObject* PyInit_cosmo(void);
PyObject* PyInit_gc(void);
PyObject* PyInit__ast(void);
PyObject* _PyWarnings_Init(void);
@ -123,7 +127,9 @@ struct _inittab _PyImport_Inittab[] = {
{"_locale", PyInit__locale},
{"_io", PyInit__io},
{"faulthandler", PyInit_faulthandler},
#ifdef USE_TRACEMALLOC
{"_tracemalloc", PyInit__tracemalloc},
#endif
{"_symtable", PyInit__symtable},
{"array", PyInit_array},
{"cmath", PyInit_cmath},
@ -184,6 +190,9 @@ struct _inittab _PyImport_Inittab[] = {
/* This lives in import.c */
{"_imp", PyInit_imp},
/* This lives in cosmomodule.c */
{"_cosmo", PyInit_cosmo},
/* This lives in Python/Python-ast.c */
{"_ast", PyInit__ast},