This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dtasev
Recipients dtasev
Date 2017-07-13.14:03:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1499954602.09.0.350222249447.issue30919@psf.upfronthosting.co.za>
In-reply-to
Content
Hello, I have noticed a significant performance regression when allocating a large shared array in Python 3.x versus Python 2.7. The affected module seems to be `multiprocessing`.

The function I used for benchmarking:

from timeit import timeit
timeit('sharedctypes.Array(ctypes.c_float, 500*2048*2048)', 'from multiprocessing import sharedctypes; import ctypes', number=1)

And the results from executing it:

Python 3.5.2
Out[2]: 182.68500420999771

-------------------

Python 2.7.12
Out[6]: 2.124835968017578

I will try to provide any information you need. Right now I am looking at callgrind/cachegrind without Debug symbols, and can post that, in the meantime I am building Python with Debug and will re-run the callgrind/cachegrind.

Allocating the same-size array with numpy doesn't seem to have a difference between Python versions. The numpy command used was `numpy.full((500,2048,2048), 5.0)`. Allocating the same number of list members also doesn't have a difference - `arr = [5.0]*(500*2048*2048)`
History
Date User Action Args
2017-07-13 14:03:22dtasevsetrecipients: + dtasev
2017-07-13 14:03:22dtasevsetmessageid: <1499954602.09.0.350222249447.issue30919@psf.upfronthosting.co.za>
2017-07-13 14:03:22dtasevlinkissue30919 messages
2017-07-13 14:03:21dtasevcreate