Re: [Python-Dev] Modify PyMem_Malloc to use pymalloc for performance
So what do you think? Is it worth to change PyMem_Malloc() allocator to pymalloc for a small speedup? Should we do something else before doing that? Or do you expect that too many applications use PyMem_Malloc() without holding the GIL and will not run try to run their application with PYTHONMALLOC=debug? Victor 2016-03-15 0:19 GMT+01:00 Victor Stinner : > 2016-02-12 14:31 GMT+01:00 M.-A. Lemburg : If your program has bugs, you can use a debug build of Python 3.5 to detect misusage of the API. >> >> Yes, but people don't necessarily do this, e.g. I have >> for a very long time ignored debug builds completely >> and when I started to try them, I found that some of the >> things I had been doing with e.g. free list implementations >> did not work in debug builds. > > I just added support for debug hooks on Python memory allocators on > Python compiled in *release* mode. Set the environment variable > PYTHONMALLOC to debug to try with Python 3.6. > > I added a check on PyObject_Malloc() debug hook to ensure that the > function is called with the GIL held. I opened an issue to add a > similar check on PyMem_Malloc(): > https://bugs.python.org/issue26563 > > >> Yes, but those are part of the stdlib. You'd need to check >> a few C extensions which are not tested as part of the stdlib, >> e.g. numpy, scipy, lxml, pillow, etc. (esp. ones which implement custom >> types in C since these will often need the memory management >> APIs). >> >> It may also be a good idea to check wrapper generators such >> as cython, swig, cffi, etc. > > I ran the test suite of numpy, lxml, Pillow and cryptography (used cffi). > > I found a bug in numpy. numpy calls PyMem_Malloc() without holding the GIL: > https://github.com/numpy/numpy/pull/7404 > > Except of this bug, all other tests pass with PyMem_Malloc() using > pymalloc and all debug checks. > > Victor ___ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Summary of Python tracker Issues
ACTIVITY SUMMARY (2016-03-18 - 2016-03-25) Python tracker at http://bugs.python.org/ To view or respond to any of the issues listed below, click on the issue. Do NOT respond to this message. Issues counts and deltas: open5461 ( +2) closed 32938 (+53) total 38399 (+55) Open issues with patches: 2379 Issues opened (32) == #20021: "modernize" makeopcodetargets.py http://bugs.python.org/issue20021 reopened by serhiy.storchaka #26589: Add HTTP Response code 451 http://bugs.python.org/issue26589 opened by rhettinger #26591: datetime datetime.time to datetime.time comparison does nothin http://bugs.python.org/issue26591 opened by jason crockett #26597: Document how to cite Python http://bugs.python.org/issue26597 opened by steven.daprano #26600: MagickMock __str__ sometimes returns MagickMock instead of str http://bugs.python.org/issue26600 opened by StanisÅaw Skonieczny (Uosiu) #26601: Use new madvise()'s MADV_FREE on the private heap http://bugs.python.org/issue26601 opened by StyXman #26602: argparse doc introduction is inappropriately targeted http://bugs.python.org/issue26602 opened by Daniel Stone #26606: logging.baseConfig is missing the encoding parameter http://bugs.python.org/issue26606 opened by janis.slapins #26608: RLock undocumented behavior in case of multiple acquire http://bugs.python.org/issue26608 opened by smbrd #26609: Wrong request target in test_httpservers.py http://bugs.python.org/issue26609 opened by xiang.zhang #26610: test_venv.test_with_pip() fails when ctypes is missing http://bugs.python.org/issue26610 opened by haypo #26612: test_ssl: use context manager (with) to fix ResourceWarning http://bugs.python.org/issue26612 opened by haypo #26615: Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc http://bugs.python.org/issue26615 opened by xiang.zhang #26616: A bug in datetime.astimezone() method http://bugs.python.org/issue26616 opened by belopolsky #26617: Assertion failed in gc with __del__ and weakref http://bugs.python.org/issue26617 opened by guojiahua #26618: _overlapped extension module of asyncio uses deprecated WSAStr http://bugs.python.org/issue26618 opened by haypo #26619: 3.5.1 install fails on Windows Server 2008 R2 64-bit http://bugs.python.org/issue26619 opened by sdmorris #26623: JSON encode: more informative error http://bugs.python.org/issue26623 opened by Mahmoud Lababidi #26624: Windows hangs in call to CRT setlocale() http://bugs.python.org/issue26624 opened by jkloth #26626: test_dbm_gnu http://bugs.python.org/issue26626 opened by ink #26627: IDLE incorrectly labeling error as internal http://bugs.python.org/issue26627 opened by Tadhg McDonald-Jensen #26628: Undefined behavior calling C functions with ctypes.Union argum http://bugs.python.org/issue26628 opened by tilsche #26629: Need an ability to build standard DLLs with distutils http://bugs.python.org/issue26629 opened by Buraddin Ibn-Karlo #26631: Unable to install Python 3.5.1 on Windows 10 - Error 0x8007064 http://bugs.python.org/issue26631 opened by oselljr #26632: __all__ decorator http://bugs.python.org/issue26632 opened by barry #26633: multiprocessing behavior combining daemon with non-daemon chil http://bugs.python.org/issue26633 opened by josh.r #26634: recursive_repr forgets to override __qualname__ of wrapper http://bugs.python.org/issue26634 opened by xiang.zhang #26638: Avoid warnings about missing CLI options when building documen http://bugs.python.org/issue26638 opened by martin.panter #26639: Tools/i18n/pygettext.py: replace deprecated imp module with im http://bugs.python.org/issue26639 opened by haypo #26640: xmlrpc.server imports xmlrpc.client http://bugs.python.org/issue26640 opened by Valentin.Lorentz #26641: doctest doesn't support packages http://bugs.python.org/issue26641 opened by haypo #26642: Replace stdout and stderr with simple standard printers at Pyt http://bugs.python.org/issue26642 opened by haypo Most recent 15 issues with no replies (15) == #26642: Replace stdout and stderr with simple standard printers at Pyt http://bugs.python.org/issue26642 #26641: doctest doesn't support packages http://bugs.python.org/issue26641 #26639: Tools/i18n/pygettext.py: replace deprecated imp module with im http://bugs.python.org/issue26639 #26638: Avoid warnings about missing CLI options when building documen http://bugs.python.org/issue26638 #26631: Unable to install Python 3.5.1 on Windows 10 - Error 0x8007064 http://bugs.python.org/issue26631 #26629: Need an ability to build standard DLLs with distutils http://bugs.python.org/issue26629 #26626: test_dbm_gnu http://bugs.python.org/issue26626 #26618: _overlapped extension module of asyncio uses deprecated WSAStr http://bugs.python.org/issue26618 #26615: Missing entry in WRAPPER_ASSIGNMENTS in update_wrapper's doc http://bugs.python.org/issue26615 #26609: Wrong request target in test_ht
