STINNER Victor added the comment:
@Andrei: Ping?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19515
___
___
Python-bugs-list mailing list
Andrei Dorian Duma added the comment:
Removed _Py_IDENTIFIERs duplicated in the same file, except:
_Py_IDENTIFIER(replace): Modules/zipimport.c:563
which was enclosed in some #ifdefs.
--
keywords: +patch
Added file:
Changes by STINNER Victor victor.stin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19515
___
Roundup Robot added the comment:
New changeset 518e3b174120 by Victor Stinner in branch 'default':
Issue #19515: Remove identifiers duplicated in the same file.
http://hg.python.org/cpython/rev/518e3b174120
--
___
Python tracker
Roundup Robot added the comment:
New changeset d2209b9f8971 by Victor Stinner in branch 'default':
Issue #19515: Remove duplicated identifiers in zipimport.c
http://hg.python.org/cpython/rev/d2209b9f8971
--
___
Python tracker rep...@bugs.python.org
Martin v. Löwis added the comment:
I'd be +0 on extracting common identifiers. I see a slight increase of
readability, and expect a slight reduction of memory usage, and a tiny
reduction in runtime. It's not really worth the effort, but I fail to see that
it causes harm.
I see no point in
STINNER Victor added the comment:
2013/11/8 Martin v. Löwis rep...@bugs.python.org:
I'd be +0 on extracting common identifiers. I (...) expect a slight reduction
of memory usage, and a tiny reduction in runtime.
Only duplicated Py_IDENTIFIER structures would be removed in memory,
but these
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +andrei.duma, loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19515
___
___
STINNER Victor added the comment:
If most identifiers are stored in the same place, it would become possible to
have a cleanup function to clear all identifiers. Such function could be
called at Python shutdown to release as much memory as possible.
--
Antoine Pitrou added the comment:
What are you trying to achieve exactly? I don't think sharing identifier
structs will gain anything significant. Please don't make the source code less
readable in search for some mythical efficiency.
--
nosy: +pitrou
Martin v. Löwis added the comment:
Victor: There already *is* a cleanup function that clears all allocated
identifier memory at interpreter shutdown. Please read the source.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
Victor: There already *is* a cleanup function that clears all allocated
identifier memory at interpreter shutdown. Please read the source.
Oh, great! I never noticed _PyUnicode_ClearStaticStrings().
Call trace: Py_Finalize() -
Martin v. Löwis added the comment:
Well, that was one of the motivations of introducing this Py_IDENTIFIER
machinery: to be able to cleanup at the end (unlike the static variables that
were used before, which couldn't be cleaned up).
--
___
Python
STINNER Victor added the comment:
Antoine, Martin: So, what do you think? Is it worth to move most common
identifiers to a single place to not duplicate them?
If identifiers are already cleared at exit, the advantage would be to
initialize duplicated identifiers more quickly, and don't
Antoine Pitrou added the comment:
Antoine, Martin: So, what do you think? Is it worth to move most common
identifiers
to a single place to not duplicate them?
Well, worth what? :)
If you don't tell us what it brings (numbers?), I'm against it.
--
STINNER Victor added the comment:
If you don't tell us what it brings (numbers?), I'm against it.
For performances, it's probably very close to zero speed up. For the memory,
it's a few bytes per duplicated identifier.
--
___
Python tracker
Antoine Pitrou added the comment:
If you don't tell us what it brings (numbers?), I'm against it.
For performances, it's probably very close to zero speed up. For
the memory, it's a few bytes per duplicated identifier.
Well, then IMHO it's not worth it.
--
STINNER Victor added the comment:
Well, then IMHO it's not worth it.
Ok, you are probably right :-)
@Andrei: Are you interested to work on a patch to remove identifiers duplicated
in the same file?
--
___
Python tracker rep...@bugs.python.org
Andrei Dorian Duma added the comment:
@Andrei: Are you interested to work on a patch to remove identifiers
duplicated in the same file?
Yes, I will provide a patch in a day or two.
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
New changeset 01c4a0af73cf by Victor Stinner in branch 'default':
Issue #19512, #19515: remove shared identifiers, move identifiers where they
http://hg.python.org/cpython/rev/01c4a0af73cf
This changeset removes some identifiers duplicated in the same file.
Roundup Robot added the comment:
New changeset 01c4a0af73cf by Victor Stinner in branch 'default':
Issue #19512, #19515: remove shared identifiers, move identifiers where they
http://hg.python.org/cpython/rev/01c4a0af73cf
--
nosy: +python-dev
___
New submission from STINNER Victor:
I started to share some common identifiers in Python/pythonrun.c, extract:
/* Common identifiers */
_Py_Identifier _PyId_argv = _Py_static_string_init(argv);
_Py_Identifier _PyId_builtins = _Py_static_string_init(builtins);
...
Do you think it would be
STINNER Victor added the comment:
_Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5132
_Py_IDENTIFIER(__delitem__): Objects/typeobject.c:5183
I moved this one to #19514.
--
___
Python tracker rep...@bugs.python.org
23 matches
Mail list logo