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
|
@ -593,7 +593,7 @@ build_time_vars = {'ABIFLAGS': 'm',
|
|||
'MODNAMES': '_decimal posix errno pwd _sre '
|
||||
'_codecs _functools _operator _collections itertools atexit '
|
||||
'_signal _stat time _locale _io zipimport faulthandler '
|
||||
'_tracemalloc _symtable array cmath math _struct _weakref '
|
||||
'_symtable array cmath math _struct _weakref '
|
||||
'_testcapi _random _elementtree _pickle _datetime _bisect _heapq '
|
||||
'unicodedata fcntl grp select mmap _csv _socket resource '
|
||||
'_posixsubprocess _md5 _sha1 _sha256 _sha512 _sha3 syslog '
|
||||
|
@ -614,7 +614,7 @@ build_time_vars = {'ABIFLAGS': 'm',
|
|||
'Modules/_iomodule.o Modules/iobase.o Modules/fileio.o '
|
||||
'Modules/bytesio.o Modules/bufferedio.o Modules/textio.o '
|
||||
'Modules/stringio.o Modules/zipimport.o Modules/faulthandler.o '
|
||||
'Modules/_tracemalloc.o Modules/hashtable.o '
|
||||
'Modules/hashtable.o '
|
||||
'Modules/symtablemodule.o Modules/arraymodule.o '
|
||||
'Modules/cmathmodule.o Modules/mathmodule.o Modules/_math.o '
|
||||
'Modules/_struct.o Modules/_weakref.o Modules/_testcapimodule.o '
|
||||
|
|
4
third_party/python/Lib/subprocess.py
vendored
4
third_party/python/Lib/subprocess.py
vendored
|
@ -263,8 +263,8 @@ def _args_from_interpreter_flags():
|
|||
|
||||
# -X options
|
||||
xoptions = getattr(sys, '_xoptions', {})
|
||||
for opt in ('faulthandler', 'tracemalloc',
|
||||
'showalloccount', 'showrefcount', 'utf8'):
|
||||
for opt in ('faulthandler', 'showalloccount',
|
||||
'showrefcount', 'utf8'):
|
||||
if opt in xoptions:
|
||||
value = xoptions[opt]
|
||||
if value is True:
|
||||
|
|
3
third_party/python/Lib/test/test_code.py
vendored
3
third_party/python/Lib/test/test_code.py
vendored
|
@ -102,6 +102,7 @@ consts: ('None',)
|
|||
|
||||
"""
|
||||
|
||||
import _cosmo
|
||||
import inspect
|
||||
import sys
|
||||
try:
|
||||
|
@ -298,6 +299,7 @@ if check_impl_detail(cpython=True) and ctypes is not None:
|
|||
# away, so we eval a lambda.
|
||||
return eval('lambda:42')
|
||||
|
||||
@unittest.skipUnless(_cosmo.MODE == "dbg", "requires APE debug build")
|
||||
def test_get_non_code(self):
|
||||
f = self.get_func()
|
||||
|
||||
|
@ -306,6 +308,7 @@ if check_impl_detail(cpython=True) and ctypes is not None:
|
|||
self.assertRaises(SystemError, GetExtra, 42, FREE_INDEX,
|
||||
ctypes.c_voidp(100))
|
||||
|
||||
@unittest.skipUnless(_cosmo.MODE == "dbg", "requires APE debug build")
|
||||
def test_bad_index(self):
|
||||
f = self.get_func()
|
||||
self.assertRaises(SystemError, SetExtra, f.__code__,
|
||||
|
|
5
third_party/python/Lib/test/test_dict.py
vendored
5
third_party/python/Lib/test/test_dict.py
vendored
|
@ -1,3 +1,4 @@
|
|||
import _cosmo
|
||||
import collections
|
||||
import collections.abc
|
||||
import gc
|
||||
|
@ -1221,7 +1222,9 @@ class CAPITest(unittest.TestCase):
|
|||
self.assertEqual(dict_getitem_knownhash(d, 'z', hash('z')), 3)
|
||||
|
||||
# not a dict
|
||||
self.assertRaises(SystemError, dict_getitem_knownhash, [], 1, hash(1))
|
||||
# find the APE compilation mode, run this test in dbg only #
|
||||
if _cosmo.MODE == "dbg":
|
||||
self.assertRaises(SystemError, dict_getitem_knownhash, [], 1, hash(1))
|
||||
# key does not exist
|
||||
self.assertRaises(KeyError, dict_getitem_knownhash, {}, 1, hash(1))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue