Message178413
> 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. |
|
Date |
User |
Action |
Args |
2012-12-28 18:45:28 | neologix | set | recipients:
+ neologix, josiahcarlson, pitrou, giampaolo.rodola, josiah.carlson, xdegaye |
2012-12-28 18:45:28 | neologix | link | issue16787 messages |
2012-12-28 18:45:28 | neologix | create | |
|