Author neologix
Recipients giampaolo.rodola, josiah.carlson, josiahcarlson, neologix, pitrou, xdegaye
Date 2012-12-28.18:45:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAH_1eM3zTsFfwS5P4BgtmOEQKWW7e7+JiUWTty=DFRfrBr4Vog@mail.gmail.com>
In-reply-to <1356717930.56.0.548554978833.issue16787@psf.upfronthosting.co.za>
Content
> What/where do you mean exactly?

"""
187     def push (self, data):
188         sabs = self.ac_out_buffer_size
189         if len(data) > sabs:
190             for i in range(0, len(data), sabs):
191                 self.producer_fifo.append(data[i:i+sabs])
"""

len(data) is called twice

"""
228             # handle classic producer behavior
229             obs = self.ac_out_buffer_size
230             try:
231                 data = first[:obs]
232             except TypeError:
233                 data = first.more()
"""

Here, I think that len(first) <= self.ac_out_buffer_size, by
definition. So the slicing is actually just a copy (I realize that it
has the side effect of checking whether it's a buffer or a producer).

memoryview is also great to avoid copies when sending/receiving to a socket.
History
Date User Action Args
2012-12-28 18:45:28neologixsetrecipients: + neologix, josiahcarlson, pitrou, giampaolo.rodola, josiah.carlson, xdegaye
2012-12-28 18:45:28neologixlinkissue16787 messages
2012-12-28 18:45:28neologixcreate