Author vstinner
Recipients benjamin.peterson, neologix, njs, pitrou, rhettinger, skrah, tim.peters, trent, vstinner, wscullin, xdegaye
Date 2017-11-02.11:37:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1509622623.33.0.213398074469.issue18835@psf.upfronthosting.co.za>
In-reply-to
Content
"C11 aligned_alloc() / free() would be more comfortable but isn't available on MSVC."

Is it common to require the allocated memory block to be filled with zeros? In Python, calloc() is not the most common allocator. I only found 5 places where calloc is used:

Modules/_ssl.c:5172:        _ssl_locks = PyMem_Calloc(_ssl_locks_count,
Modules/gcmodule.c:1689:        g = (PyGC_Head *)PyObject_Calloc(1, size);
Modules/gcmodule.c:1717:_PyObject_GC_Calloc(size_t basicsize)
Objects/bytesobject.c:83:        op = (PyBytesObject *)PyObject_Calloc(1, PyBytesObject_SIZE + size);
Objects/listobject.c:176:        op->ob_item = (PyObject **) PyMem_Calloc(size, sizeof(PyObject *));


"posix_memalign() performance isn't that great. hand-rolled aligned_calloc() is the fastest."

I'm not sure that the cost of the memory allocator itself defeats the gain of aligned memory on algorithms. I expect data processing to be much more expensive than the memory allocation, no?

Again, the unknown remains the benchmark result.

Can anyone write a quick benchmark to measure the gain of aligned memory? 4 years ago, Raymond Hettinger wanted to use it for the set and collection.deque types.
History
Date User Action Args
2017-11-02 11:37:03vstinnersetrecipients: + vstinner, tim.peters, rhettinger, pitrou, benjamin.peterson, trent, njs, skrah, neologix, xdegaye, wscullin
2017-11-02 11:37:03vstinnersetmessageid: <1509622623.33.0.213398074469.issue18835@psf.upfronthosting.co.za>
2017-11-02 11:37:03vstinnerlinkissue18835 messages
2017-11-02 11:37:03vstinnercreate