Author pfalcon
Recipients ncoghlan, pfalcon, serhiy.storchaka, terry.reedy
Date 2014-04-13.15:19:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1397402349.42.0.233488933208.issue21180@psf.upfronthosting.co.za>
In-reply-to
Content
> >>> array.array('i', [0]) * 3

@Serhiy Storchaka:

The keyword is "efficiently". Let's analyze: this creates useless array.array('i', [0]) object destined only for garbage collection. Then, it forces using loop of loops to fill in a new object. Whereas array.array('i', 3) immediately reduces to a memset().

You can say that these implementation efficiency issues are of little concert to CPython. But what's being reported here is that, while generally Python is pretty good in allowing to efficiently process raw binary data (memoryview and all other bits and pieces), there are inconsistent accidental gaps in API here and there which jeopardize  efficiency, in obvious way (and also obvious to resolve), what may be of concern for other Python implementations (my case).
History
Date User Action Args
2014-04-13 15:19:09pfalconsetrecipients: + pfalcon, terry.reedy, ncoghlan, serhiy.storchaka
2014-04-13 15:19:09pfalconsetmessageid: <1397402349.42.0.233488933208.issue21180@psf.upfronthosting.co.za>
2014-04-13 15:19:09pfalconlinkissue21180 messages
2014-04-13 15:19:08pfalconcreate