[pypy-issue] [issue1022] dict.update significantly slower than series of dict.__setitem__

Armin Rigo tracker at bugs.pypy.org
Sat Feb 18 12:19:07 CET 2012

Armin Rigo <armin.rigo at gmail.com> added the comment:

It probably doesn't help: the issue seems to be the slowness of "**kwds"
argument passing.  If you're thinking about app-level, then it's code like that:

def update(d, **kwds):
    for key, value in kwds.items():   # or iteritems()
        d[key] = value

But that would be much slower than a series of direct setitems, and most
probably also slower than the RPython equivalent that we have now.

To fix this we need to think about how to improve __args__.parse_obj() in a way
that lets it enumerate the keywords without actually building a w_kwds dictionary.

nosy: +arigo

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list