Patches item #1629718, was opened at 2007-01-07 14:51
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1629718&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Hirokazu Yamamoto (ocean-city)
Assigned to: Nobody/Anonymous (nobody)
Summary: fast tuple[index] by inlining on BINARY_SUBSCR

Initial Comment:
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.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1629718&group_id=5470
_______________________________________________
Patches mailing list
Patches@python.org
http://mail.python.org/mailman/listinfo/patches

Reply via email to