Message51686
Hello.
I noticed there is speed difference between
a = [0,] # list
a[0] # fast
and
a = (0,) # tuple
a[0] # slow
while solving ICPC puzzle with Python.
I thought this is wierd because, indeed tuple is readonly, there is no conceptual difference between list and tuple when 'extract' item from them.
After investigation, I found this difference comes from the shortcut for list on ceval.c (BINARY_SUBSCR).
Is it valuable to put shortcut for tuple too? I'll attach the patch for release-maint25 branch. Thank you.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:56:08 | admin | link | issue1629718 messages |
2007-08-23 15:56:08 | admin | create | |
|