Perform build and magnum tuning

Building o//third_party/python now takes 5 seconds on my PC

This change works towards modifying Python to use runtime dispatching
when appropriate. For example, when loading the magnums in the socket
module, it's a good idea to check if the magnum is zero, because that
means the local system platform doesn't support it.
This commit is contained in:
Justine Tunney 2021-08-10 10:26:13 -07:00
parent ee7e296339
commit d26d7ae0e4
1028 changed files with 6576 additions and 172777 deletions

View file

@ -1,3 +1,5 @@
/* clang-format off */
/* clang-format off */
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* stringlib: codec implementations */
#if !STRINGLIB_IS_UNICODE

View file

@ -1,7 +1,8 @@
/* clang-format off */
/* stringlib: count implementation */
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#error must include fastsearch.inc before including this module
#endif
Py_LOCAL_INLINE(Py_ssize_t)

View file

@ -1,8 +1,9 @@
/* clang-format off */
#if STRINGLIB_IS_UNICODE
# error "ctype.h only compatible with byte-wise strings"
#endif
#include "bytes_methods.h"
#include "third_party/python/Include/bytes_methods.h"
static PyObject*
stringlib_isspace(PyObject *self)

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* Fast unicode equal function optimized for dictobject.c and setobject.c */
/* Return 1 if two unicode objects are equal, 0 if not.

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* stringlib: fastsearch implementation */
#define STRINGLIB_FASTSEARCH_H

View file

@ -1,7 +1,8 @@
/* clang-format off */
/* stringlib: find/index implementation */
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#error must include fastsearch.inc before including this module
#endif
Py_LOCAL_INLINE(Py_ssize_t)

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* Finding the optimal width of unicode characters in a buffer */
#if !STRINGLIB_IS_UNICODE

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* stringlib: bytes joining implementation */
#if STRINGLIB_IS_UNICODE

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* _PyUnicode_InsertThousandsGrouping() helper functions */
typedef struct {

View file

@ -1,7 +1,8 @@
/* clang-format off */
/* stringlib: partition implementation */
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#error must include fastsearch.inc before including this module
#endif
Py_LOCAL_INLINE(PyObject*)

View file

@ -1,7 +1,8 @@
/* clang-format off */
/* stringlib: replace implementation */
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#error must include fastsearch.inc before including this module
#endif
Py_LOCAL_INLINE(void)

View file

@ -1,7 +1,8 @@
/* clang-format off */
/* stringlib: split implementation */
#ifndef STRINGLIB_FASTSEARCH_H
#error must include "stringlib/fastsearch.h" before including this module
#error must include fastsearch.inc before including this module
#endif
/* Overallocate the initial list to reduce the number of reallocs for small

View file

@ -1,3 +1,4 @@
/* clang-format off */
#ifndef STRINGLIB_STRINGDEFS_H
#define STRINGLIB_STRINGDEFS_H

View file

@ -1,3 +1,4 @@
/* clang-format off */
#if STRINGLIB_IS_UNICODE
# error "transmogrify.h only compatible with byte-wise strings"
#endif

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */

View file

@ -1,3 +1,4 @@
/* clang-format off */
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */

View file

@ -1,3 +1,4 @@
/* clang-format off */
#undef FASTSEARCH
#undef STRINGLIB
#undef STRINGLIB_SIZEOF_CHAR

View file

@ -1,3 +1,4 @@
/* clang-format off */
/*
unicode_format.h -- implementation of str.format().
*/

View file

@ -1,3 +1,4 @@
/* clang-format off */
#ifndef STRINGLIB_UNICODEDEFS_H
#define STRINGLIB_UNICODEDEFS_H