mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
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:
parent
31dd714081
commit
27f7ffd4fd
15 changed files with 175 additions and 12 deletions
2
third_party/python/Objects/abstract.c
vendored
2
third_party/python/Objects/abstract.c
vendored
|
@ -2210,6 +2210,7 @@ PyObject_CallObject(PyObject *o, PyObject *a)
|
|||
return PyEval_CallObjectWithKeywords(o, a, NULL);
|
||||
}
|
||||
|
||||
#ifdef MODE_DBG
|
||||
PyObject*
|
||||
_Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where)
|
||||
{
|
||||
|
@ -2257,6 +2258,7 @@ _Py_CheckFunctionResult(PyObject *func, PyObject *result, const char *where)
|
|||
}
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
PyObject *
|
||||
PyObject_Call(PyObject *func, PyObject *args, PyObject *kwargs)
|
||||
|
|
5
third_party/python/Objects/obmalloc.c
vendored
5
third_party/python/Objects/obmalloc.c
vendored
|
@ -16,9 +16,10 @@
|
|||
#include "third_party/python/Include/pymem.h"
|
||||
/* clang-format off */
|
||||
|
||||
#ifdef MODE_DBG
|
||||
/* Defined in tracemalloc.c */
|
||||
extern void _PyMem_DumpTraceback(int fd, const void *ptr);
|
||||
|
||||
#endif
|
||||
|
||||
/* Python's malloc wrappers (see pymem.h) */
|
||||
|
||||
|
@ -2196,7 +2197,9 @@ _PyObject_DebugDumpAddress(const void *p)
|
|||
fputc('\n', stderr);
|
||||
|
||||
fflush(stderr);
|
||||
#ifdef USE_TRACEMALLOC
|
||||
_PyMem_DumpTraceback(fileno(stderr), p);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue