[issue40077] Convert static types to PyType_FromSpec()

2020-08-26 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset 31967fd8d0220af84e2698172d1378bffc8cd851 by Dong-hee Na in branch 'master': bpo-40077: Convert _operator to use PyType_FromSpec (GH-21954) https://github.com/python/cpython/commit/31967fd8d0220af84e2698172d1378bffc8cd851 --

[issue40077] Convert static types to PyType_FromSpec()

2020-08-25 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +21063 pull_request: https://github.com/python/cpython/pull/21954 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-08-25 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +21062 pull_request: https://github.com/python/cpython/pull/21953 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-06-25 Thread STINNER Victor
STINNER Victor added the comment: The Tools/scripts/abitype.py script can help to port C extensions to PyType_FromSpec(). -- ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: See meta bpo-15787 "PEP 3121, 384 Refactoring" which tracks all these issues as dependencies. -- ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: Search also for issues with "384" in their title (34 open issues):

[issue40077] Convert static types to PyType_FromSpec()

2020-06-22 Thread STINNER Victor
STINNER Victor added the comment: For example, see bpo-15849 for the xx module. -- ___ Python tracker ___ ___ Python-bugs-list

[issue40077] Convert static types to PyType_FromSpec()

2020-06-19 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset ec689187957cc80af56b9a63251bbc295bafd781 by Dong-hee Na in branch 'master': bpo-40077: Convert _bz2 module to use PyType_FromSpec (GH-20960) https://github.com/python/cpython/commit/ec689187957cc80af56b9a63251bbc295bafd781 --

[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +20151 pull_request: https://github.com/python/cpython/pull/20974 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread STINNER Victor
STINNER Victor added the comment: PR 20960 (_bz2 module) triggers an interesting question. The effect of converting a static type to a heap type on pickle, especially for protocols 0 and 1. pickle.dumps(o, 0) calls object.__reduce__(o) which calls copyreg._reduce_ex(o, 0).

[issue40077] Convert static types to PyType_FromSpec()

2020-06-18 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +20139 pull_request: https://github.com/python/cpython/pull/20960 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-06-09 Thread Erlend Egeberg Aasland
Change by Erlend Egeberg Aasland : -- nosy: +erlendaasland ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-06-09 Thread STINNER Victor
STINNER Victor added the comment: I tried to finalize static types in Py_Finalize(), but it didn't work: * https://bugs.python.org/issue1635741#msg371119 * https://github.com/python/cpython/pull/20763 -- ___ Python tracker

[issue40077] Convert static types to PyType_FromSpec()

2020-06-05 Thread STINNER Victor
Change by STINNER Victor : -- components: +Subinterpreters ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-05-11 Thread STINNER Victor
STINNER Victor added the comment: See also bpo-40601: [C API] Hide static types from the limited C API. -- ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-04-09 Thread Dong-hee Na
Dong-hee Na added the comment: New changeset dcb04d9c6dd6f31449ade6765fa4d26a305e7381 by Hai Shi in branch 'master': bpo-40077: Remove redundant cast in json module (GH-19438) https://github.com/python/cpython/commit/dcb04d9c6dd6f31449ade6765fa4d26a305e7381 --

[issue40077] Convert static types to PyType_FromSpec()

2020-04-08 Thread Eric Snow
Eric Snow added the comment: > Wouldn't having less static types slow down startup time? FWIW, I've been considering an approach where the main interpreter keeps using static types but subinterpreters use heap types. If it isn't too much effort (or too hacky) then it might be a sufficient

[issue40077] Convert static types to PyType_FromSpec()

2020-04-08 Thread hai shi
Change by hai shi : -- pull_requests: +18792 pull_request: https://github.com/python/cpython/pull/19438 ___ Python tracker ___ ___

[issue40077] Convert static types to PyType_FromSpec()

2020-04-04 Thread STINNER Victor
STINNER Victor added the comment: New changeset b709302f3125622986bd458dfb2954fda5e8366d by Hai Shi in branch 'master': bpo-40077: Fix potential refleaks of _json: traverse memo (GH-19344) https://github.com/python/cpython/commit/b709302f3125622986bd458dfb2954fda5e8366d --

[issue40077] Convert static types to PyType_FromSpec()

2020-04-03 Thread hai shi
Change by hai shi : -- pull_requests: +18708 pull_request: https://github.com/python/cpython/pull/19344 ___ Python tracker ___ ___

[issue40077] Convert static types to PyType_FromSpec()

2020-04-03 Thread hai shi
Change by hai shi : -- pull_requests: +18705 pull_request: https://github.com/python/cpython/pull/19341 ___ Python tracker ___ ___

[issue40077] Convert static types to PyType_FromSpec()

2020-04-01 Thread STINNER Victor
STINNER Victor added the comment: > bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202) This change introduced a reference leak: bpo-40149 "test_threading leaked [38, 38, 38] references, sum=114". -- ___ Python tracker

[issue40077] Convert static types to PyType_FromSpec()

2020-03-30 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-03-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 53e4c91725083975598350877e2ed8e2d0194114 by Dong-hee Na in branch 'master': bpo-40077: Convert _abc module to use PyType_FromSpec() (GH-19202) https://github.com/python/cpython/commit/53e4c91725083975598350877e2ed8e2d0194114 --

[issue40077] Convert static types to PyType_FromSpec()

2020-03-29 Thread Dong-hee Na
Dong-hee Na added the comment: > You pass a *type to isinstance() in bench_isinstance_check.py. Thanks for the catch my mistake. The result is showing: Not significant (1): bench _abc_instancecheck -- Added file: https://bugs.python.org/file49009/bench_isinstance_check.py

[issue40077] Convert static types to PyType_FromSpec()

2020-03-29 Thread STINNER Victor
STINNER Victor added the comment: IMO 1.01x slower on a *microbenchmark* is not significant so it's ok. Thanks for checking. You pass a *type to isinstance() in bench_isinstance_check.py. You should pass *an instance* instead. Like (complete the (...) ;-)): runner.timeit(name="bench

[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na
Dong-hee Na added the comment: > Can you try to measure the _abc._abc_instancecheck() and > _abc._abc_subclasscheck() I 've submitted the benchmark :) -- ___ Python tracker

[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na
Change by Dong-hee Na : Added file: https://bugs.python.org/file49008/bench_subclass_check.py ___ Python tracker ___ ___ Python-bugs-list

[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na
Change by Dong-hee Na : Added file: https://bugs.python.org/file49007/bench_isinstance_check.py ___ Python tracker ___ ___ Python-bugs-list

[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread Dong-hee Na
Dong-hee Na added the comment: It shown 1% slower for performance. +--+-++ | Benchmark| master-subclass | bpo-40077-subclass |

[issue40077] Convert static types to PyType_FromSpec()

2020-03-28 Thread STINNER Victor
STINNER Victor added the comment: > Should we stop the work until the overhead is measured? Can you try to measure the _abc._abc_instancecheck() and _abc._abc_subclasscheck() functions performance before/after your change? Functions like register() are rarely call, so I don't care much of

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Dong-hee Na
Dong-hee Na added the comment: > And I would prefer to first see the overhead of PyType_FromSpec(), and > discuss the advantages and drawbacks. Should we stop the work until the overhead is measured? -- ___ Python tracker

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Dong-hee Na
Change by Dong-hee Na : -- pull_requests: +18565 pull_request: https://github.com/python/cpython/pull/19202 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Stefan Krah
Stefan Krah added the comment: > Or maybe _decimal_state_global was used in "hot code". Yes, _decimal has problems here that most modules don't have. Modules like atexit are obviously fine. :) I just posted it as an example why one should be a bit cautious. > The PEP 573 is going to give

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread STINNER Victor
STINNER Victor added the comment: In the _json module, PyModule_GetState() (called by get_json_state()) is only used by the garbage collector (traverse function) and to unload the module (clear and free functions). It's not used in "hot code" (let me consider that the GC is not part of the

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread Stefan Krah
Stefan Krah added the comment: > Wouldn't having less static types slow down startup time? Yes, and not only startup time: https://bugs.python.org/issue15722 -- nosy: +skrah ___ Python tracker

[issue40077] Convert static types to PyType_FromSpec()

2020-03-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset 33f15a16d40cb8010a8c758952cbf88d7912ee2d by Dong-hee Na in branch 'master': bpo-40077: Convert _json module to use PyType_FromSpec() (GH-19177) https://github.com/python/cpython/commit/33f15a16d40cb8010a8c758952cbf88d7912ee2d --

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Dong-hee Na
Change by Dong-hee Na : -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Dong-hee Na
Change by Dong-hee Na : -- components: +C API ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Paulo Henrique Silva
Change by Paulo Henrique Silva : -- nosy: +phsilva ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread STINNER Victor
STINNER Victor added the comment: Pablo: > Wouldn't having less static types slow down startup time? That's possible, even if I only expect a minor or non significant overhead. But before starting talking about performances, we should focus on the correctness. Static types are causing

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- Removed message: https://bugs.python.org/msg365116 ___ Python tracker ___ ___ Python-bugs-list

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Wouldn't having less static types slow down startup time? -- ___ Python tracker ___ ___

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Wouldn't having more static types slow down startup time? -- nosy: +pablogsal ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +18537 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19177 ___ Python tracker ___

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread STINNER Victor
STINNER Victor added the comment: > We need to convert them. Let me elaborate. Static types have multiple issues: * Their lifetime is not well defined. * It is not obvious when they are ready to be used. * They are not destroyed at exit. * They are incompatible with subinterpreters: each

[issue40077] Convert static types to PyType_FromSpec()

2020-03-26 Thread Dong-hee Na
New submission from Dong-hee Na : Some of modules is not using PyType_FromSpec. We need to convert them. This changes can bring - allow to destroy types at exit! - allow subinterpreters to have their own "isolated" typ -- messages: 365087 nosy: corona10, vstinner priority: normal