This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年03月15日 18:22 by exarkun, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| getargs.patch | exarkun, 2012年03月15日 19:10 | review | ||
| leak.py | skrah, 2012年03月16日 16:56 | |||
| Messages (7) | |||
|---|---|---|---|
| msg155926 - (view) | Author: Jean-Paul Calderone (exarkun) * (Python committer) | Date: 2012年03月15日 18:22 | |
Allocating a Python list and a bunch of Capsules for each PyArg_ParseTuple call is expensive and unnecessarily complicated. The freelist never escapes getargs.c (if it ever did, it would be a bug). The same job can be accomplished with a normal C array. |
|||
| msg156020 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月16日 12:52 | |
New changeset 9fc456ac20cf by Jean-Paul Calderone in branch 'default': Issue #14325: Stop using python lists, capsules, and the garbage collector to deal with PyArg_Parse* cleanup. http://hg.python.org/cpython/rev/9fc456ac20cf |
|||
| msg156022 - (view) | Author: Eli Bendersky (eli.bendersky) * (Python committer) | Date: 2012年03月16日 13:05 | |
This is cool! Any benchmark / speedup data? |
|||
| msg156024 - (view) | Author: Jean-Paul Calderone (exarkun) * (Python committer) | Date: 2012年03月16日 13:07 | |
If it's a bit faster, that'd be a nice win, but I didn't benchmark. I'm primarily interested in correctness in the PyPy case (PyPy re-uses this code), and I think CPython benefits from the slightly simplified code as well. If you do any benchmarks, I'd love to hear the results, though. :) |
|||
| msg156057 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年03月16日 16:55 | |
I'm getting a leak since this revision: ./configure --without-pymalloc CFLAGS="-O0 -g" && make valgrind --db-attach=yes --suppressions=./Misc/valgrind-python.supp --leak-check=full ./python leak.py ==32303== 16 bytes in 1 blocks are definitely lost in loss record 3 of 2,489 ==32303== at 0x4C27878: malloc (vg_replace_malloc.c:236) ==32303== by 0x41DDB0: PyMem_Malloc (object.c:1841) ==32303== by 0x4A72BF: vgetargskeywords (getargs.c:1432) ==32303== by 0x4A6E1C: PyArg_ParseTupleAndKeywords (getargs.c:1301) ==32303== by 0x55D1C8: float_new (floatobject.c:1557) ==32303== by 0x42B643: type_call (typeobject.c:708) ==32303== by 0x532A9F: PyObject_Call (abstract.c:2150) ==32303== by 0x491483: do_call (ceval.c:4260) ==32303== by 0x490A33: call_function (ceval.c:4063) ==32303== by 0x48BD49: PyEval_EvalFrameEx (ceval.c:2662) ==32303== by 0x48EA11: PyEval_EvalCodeEx (ceval.c:3414) ==32303== by 0x482FC6: PyEval_EvalCode (ceval.c:771) |
|||
| msg156058 - (view) | Author: Stefan Krah (skrah) * (Python committer) | Date: 2012年03月16日 16:56 | |
Here's leak.py. |
|||
| msg156067 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年03月16日 18:26 | |
New changeset d08f0f3ab23e by Benjamin Peterson in branch 'default': plug memory leak (closes #14325) http://hg.python.org/cpython/rev/d08f0f3ab23e |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:28 | admin | set | github: 58533 |
| 2012年03月16日 18:26:10 | python-dev | set | status: open -> closed messages: + msg156067 stage: resolved |
| 2012年03月16日 16:56:41 | skrah | set | files:
+ leak.py messages: + msg156058 |
| 2012年03月16日 16:55:21 | skrah | set | status: closed -> open nosy: + skrah messages: + msg156057 |
| 2012年03月16日 13:07:57 | exarkun | set | messages: + msg156024 |
| 2012年03月16日 13:05:29 | eli.bendersky | set | nosy:
+ eli.bendersky messages: + msg156022 |
| 2012年03月16日 12:53:54 | exarkun | set | status: open -> closed resolution: fixed |
| 2012年03月16日 12:52:00 | python-dev | set | nosy:
+ python-dev messages: + msg156020 |
| 2012年03月15日 19:10:03 | exarkun | set | files:
+ getargs.patch keywords: + patch |
| 2012年03月15日 18:22:39 | exarkun | create | |