classification
Title: Possible optimisations in kwargs handling
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder: Speed hack for function calls with named parameters
View: 1819
Assigned To: Nosy List: amaury.forgeotdarc, brian.curtin, pitrou
Priority: normal Keywords:

Created on 2008-02-06 00:45 by amaury.forgeotdarc, last changed 2010-01-20 16:14 by brian.curtin. This issue is now closed.

Messages (3)
msg62085 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-02-06 00:45
This is a reminder for the comment on top of ceval.c:
/* XXX TO DO:
   XXX speed up searching for keywords by using a dictionary
   XXX document it!
   */

It was also suggested to disallow subclasses of str in variable names,
in order to optimize comparisons. This restriction is not necessary if a
dict lookup is used: comparisons are less frequent and will often
succeed when comparing pointers of interned strings.
msg62267 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-02-11 00:40
Amaury, you may take a look at the patch in issue #1819.
Also, dict lookups have a big overhead compared to raw pointer compares,
I'm not sure naively converting all kwargs handling to dict lookups
would make things faster.
msg98083 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-01-20 16:14
This was handled in r65241 as a result of #1819.
History
Date User Action Args
2010-01-20 16:14:22brian.curtinsetstatus: open -> closed

superseder: Speed hack for function calls with named parameters

nosy: + brian.curtin
messages: + msg98083
resolution: fixed
stage: resolved
2008-02-11 00:40:19pitrousetnosy: + pitrou
messages: + msg62267
2008-02-06 12:06:30christian.heimessetpriority: normal
components: + Interpreter Core
2008-02-06 00:45:14amaury.forgeotdarccreate