Message70605
How much does the optimization speed up (or slow down?) a more normal
case when it is applicable?
bl = [b'', b'a']
How much does the optimization slow down the normal case where it is not
applied?
bl = [b'a']*2
bl = [b'a']*10000
Could not the .join user simply not add empty list items?
Looking at the code, there appear to be 4 extra operations for every
item in the normal case: assign item_size, test item_size, assign
nonempty, increment nb_nonempty. I believe this alternative might be
generally faster. Before the normal scan,
if seplen == 0:
for item in seq:
<if second non-null item>: break
else:
<do shortcut and return>
<do normal process>
Then normal cases will bail out on the second item and continue without
further impact. |
|
Date |
User |
Action |
Args |
2008-08-01 23:20:51 | terry.reedy | set | recipients:
+ terry.reedy, loewis, rhettinger, pitrou |
2008-08-01 23:20:51 | terry.reedy | set | messageid: <1217632851.72.0.253332599253.issue3459@psf.upfronthosting.co.za> |
2008-08-01 23:20:51 | terry.reedy | link | issue3459 messages |
2008-08-01 23:20:50 | terry.reedy | create | |
|