[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-dev
Subject:    [pypy-dev] Issue #1776: Creating instances of a namedtuple is inexplicably very slow (pypy/pypy)
From:       "Alex Gaynor" <issues-reply () bitbucket ! org>
Date:       2014-05-23 5:49:51
Message-ID: 20140523054951.31268.19128 () app05 ! ash-private ! bitbucket ! org
[Download RAW message or body]

New issue 1776: Creating instances of a namedtuple is inexplicably very slow
https://bitbucket.org/pypy/pypy/issue/1776/creating-instances-of-a-namedtuple-is

Alex Gaynor:

Compare:

```
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = (1, 2)" 1000000000 loops, best of 3: 0.000867 usec per loop
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = (1, 2)" 1000000000 loops, best of 3: 0.000867 usec per loop
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = (1, 2)" 1000000000 loops, best of 3: 0.00087 usec per loop
$
$
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = pos(1, 2)" 100000000 loops, best of 3: 0.026 usec per loop
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = pos(1, 2)" 100000000 loops, best of 3: 0.0264 usec per loop
$ pypy -mtimeit -s "from collections import namedtuple; pos = namedtuple('pos', ['x', \
'y'])" "p = pos(1, 2)" 100000000 loops, best of 3: 0.0268 usec per loop
```

Looking at the traces, I don't see anything that explains the difference in the \
`jit-log-opt-loop` section, however looking at `jit-summary`, I see that the \
namedtuple version compiles many many more bridges, we should figure out why.


_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic