[issue42500] crash with unbounded recursion in except statement

2020-12-02 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42246] Implement PEP 626

2020-12-02 Thread Mark Shannon
Mark Shannon added the comment: New changeset 5977a7989d49c3e095c7659a58267d87a17b12b1 by Mark Shannon in branch 'master': bpo-42246: Make sure that line number is correct after a return, as required by PEP 626 (GH-23495) https://github.com/python/cpython/commit

[issue42500] crash with unbounded recursion in except statement

2020-12-02 Thread Mark Shannon
Mark Shannon added the comment: New changeset 4e7a69bdb63a104587759d7784124492dcdd496e by Mark Shannon in branch 'master': bpo-42500: Fix recursion in or after except (GH-23568) https://github.com/python/cpython/commit/4e7a69bdb63a104587759d7784124492dcdd496e

[issue42454] Move slice creation to the compiler for constants

2020-11-30 Thread Mark Shannon
Mark Shannon added the comment: I agree with Mark about slice hashing. This looks like a deliberate design decision. x[:] = [] should empty a sequence, not set the key-value pair (slice(None, None, None), []) in a mapping. However, code-objects can still be hashable even if slices

[issue42500] crash with unbounded recursion in except statement

2020-11-30 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +22449 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23568 ___ Python tracker <https://bugs.python.org/issu

[issue42509] Recursive calls crash interpreter when checking exceptions

2020-11-30 Thread Mark Shannon
Mark Shannon added the comment: Duplicate of 42500 -- nosy: +Mark.Shannon resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42500] crash with unbounded recursion in except statement

2020-11-30 Thread Mark Shannon
Mark Shannon added the comment: Ronald's test case also causes a Fatal Error on master. 2.7.18 produces the expected "RuntimeError: maximum recursion depth exceeded" -- assignee: -> Mark.Shannon ___ Python tracker <https:/

[issue42246] Implement PEP 626

2020-11-24 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +22384 pull_request: https://github.com/python/cpython/pull/23495 ___ Python tracker <https://bugs.python.org/issue42

[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-23 Thread Mark Shannon
Mark Shannon added the comment: https://github.com/python/peps/pull/1722/ -- ___ Python tracker <https://bugs.python.org/issue42373> ___ ___ Python-bugs-list m

[issue42349] Compiler front-end produces a broken CFG

2020-11-23 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-11-17 Thread Mark Shannon
Mark Shannon added the comment: New changeset 48a9c0eb2a3304ea64d1b32fdf9db853d5d8c429 by Irit Katriel in branch '3.9': [3.9] bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) (GH-23303) https://github.com/python/cpython/commit

[issue42349] Compiler front-end produces a broken CFG

2020-11-17 Thread Mark Shannon
Mark Shannon added the comment: New changeset 266b462238bddec0213effad3650f19c56511e9f by Mark Shannon in branch 'master': bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267) https://github.com/python/cpython/commit/266b462238bddec0213effad3650f19c56511e9f

[issue42202] Optimize function annotation

2020-11-17 Thread Mark Shannon
Mark Shannon added the comment: For top level functions (functions created once) this isn't going to make any real difference. There might be a small speedup for function creation, but it isn't going to be measurable. For nested functions with annotations, where many functions are created

[issue42373] PEP 626 does not specify behavior of tracing for keywords.

2020-11-16 Thread Mark Shannon
New submission from Mark Shannon : PEP 626 doesn't cover which keywords are to be traced if they occur on a line by themselves. Some keywords, like `break`, in Python have behavior associated with them. Others, like `else` are just syntax and don't do anything. Currently, it is not clear

[issue42349] Compiler front-end produces a broken CFG

2020-11-13 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +22163 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23267 ___ Python tracker <https://bugs.python.org/issu

[issue42349] Compiler front-end produces a broken CFG

2020-11-13 Thread Mark Shannon
New submission from Mark Shannon : The front-end of the bytecode compiler produces a broken CFG. A number of "basic-block"s have terminators before their end. This makes the back-end optimizations unsafe as they rely of a well-formed CFG. The fix is simple. Insert a check that the C

[issue42246] Implement PEP 626

2020-11-13 Thread Mark Shannon
Mark Shannon added the comment: New changeset fd009e606a48e803e7187983bf9a5682e938fddb by Mark Shannon in branch 'master': bpo-42246: Fix memory leak in compiler (GH-23256) https://github.com/python/cpython/commit/fd009e606a48e803e7187983bf9a5682e938fddb

[issue42246] Implement PEP 626

2020-11-13 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +22153 pull_request: https://github.com/python/cpython/pull/23256 ___ Python tracker <https://bugs.python.org/issue42

[issue42246] Implement PEP 626

2020-11-12 Thread Mark Shannon
Mark Shannon added the comment: New changeset cc75ab791dd5ae2cb9f6e0c3c5f734a6ae1eb2a9 by Mark Shannon in branch 'master': bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251) https://github.com/python/cpython/commit/cc75ab791dd5ae2cb9f6e0c3c5f734a6ae1eb2a9

[issue42246] Implement PEP 626

2020-11-12 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +22148 pull_request: https://github.com/python/cpython/pull/23251 ___ Python tracker <https://bugs.python.org/issue42

[issue42246] Implement PEP 626

2020-11-12 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +22142 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23245 ___ Python tracker <https://bugs.python.org/issu

[issue42246] Implement PEP 626

2020-11-12 Thread Mark Shannon
Mark Shannon added the comment: New changeset 877df851c3ecdb55306840e247596e7b7805a60a by Mark Shannon in branch 'master': bpo-42246: Partial implementation of PEP 626. (GH-23113) https://github.com/python/cpython/commit/877df851c3ecdb55306840e247596e7b7805a60a

[issue42294] [C API] Add new C functions with more regular reference counting like PyTuple_GetItemRef()

2020-11-09 Thread Mark Shannon
Mark Shannon added the comment: I'm not convinced that this is worth the effort. The old functions aren't going away, so these additional functions provide no real safety. You can't stop C programmers trading away correctness for some perceived performance benefit :( If we were designing

[issue42246] Implement PEP 626

2020-11-03 Thread Mark Shannon
Change by Mark Shannon : -- nosy: +nedbat ___ Python tracker <https://bugs.python.org/issue42246> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42246] Implement PEP 626

2020-11-03 Thread Mark Shannon
Mark Shannon added the comment: The following code is completely eliminated by the macros. 1. if 0: 2. secret_debugging_code() PEP 626 says that all executed lines of code must generate trace events, so we need to emit an instruction for line 1. Dead code elimination will remove

[issue42246] Implement PEP 626

2020-11-02 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +22030 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23113 ___ Python tracker <https://bugs.python.org/issu

[issue42246] Implement PEP 626

2020-11-02 Thread Mark Shannon
New submission from Mark Shannon : Implementation of PEP 626 requires: 1. Implementation of the new line number table and associated APIs. 2. Removal of BEGIN_DO_NOT_EMIT_BYTECODE and END_DO_NOT_EMIT_BYTECODE from the compiler as they do not understand line numbers and may remove lines from

[issue42217] compiler: merge co_code and co_lnotab

2020-10-31 Thread Mark Shannon
Mark Shannon added the comment: PEP 626 has just been accepted. Could you please leave this until I have merged in the implementation of PEP 626 which uses a different line number table format -- nosy: +Mark.Shannon ___ Python tracker <ht

[issue42099] Fix reference to ob_type in unionobject.c and ceval

2020-10-27 Thread Mark Shannon
Mark Shannon added the comment: Thanks Neil -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42099] Fix reference to ob_type in unionobject.c and ceval

2020-10-27 Thread Mark Shannon
Mark Shannon added the comment: New changeset 0564aafb71a153dd0aca4b9266dfae9336a4f2cb by Neil Schemenauer in branch 'master': bpo-42099: Fix reference to ob_type in unionobject.c and ceval (GH-22829) https://github.com/python/cpython/commit/0564aafb71a153dd0aca4b9266dfae9336a4f2cb

[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Mark Shannon
Mark Shannon added the comment: It sounds like the root cause is that annotations are repeatedly being computed. We should address the underlying issue, IMO. -- ___ Python tracker <https://bugs.python.org/issue42

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Mark Shannon
Mark Shannon added the comment: Could we get a pyperformance benchmark run on this please? -- nosy: +Mark.Shannon ___ Python tracker <https://bugs.python.org/issue41

[issue42126] Optimize BUILD_CONST_KEY_MAP for distinct keys

2020-10-23 Thread Mark Shannon
Mark Shannon added the comment: Is this worthwhile? Statically, BUILD_CONST_KEY_MAP represents 0.14% of all bytecode instructions in the standard library, but only 0.03% of the bytecode instructions in functions. Which suggests that dynamically only 1 in 3000 instructions executed

[issue42057] peephole optimizer bug relating to JUMP_IF_NOT_EXC_MATCH

2020-10-22 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +21825 pull_request: https://github.com/python/cpython/pull/22893 ___ Python tracker <https://bugs.python.org/issue42

[issue42057] pytest case which catch exceptions become segfault

2020-10-19 Thread Mark Shannon
Mark Shannon added the comment: The test example has no reference to pytest in it. How are you running it? Can you produce a segmentation fault when run without pytest? -- ___ Python tracker <https://bugs.python.org/issue42

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2020-10-16 Thread Mark Shannon
Mark Shannon added the comment: Yes, thanks for pointing that out. -- ___ Python tracker <https://bugs.python.org/issue33387> ___ ___ Python-bugs-list mailin

[issue33387] Simplify bytecodes for try-finally, try-except and with blocks.

2020-10-16 Thread Mark Shannon
Change by Mark Shannon : -- pull_requests: +21689 pull_request: https://github.com/python/cpython/pull/22723 ___ Python tracker <https://bugs.python.org/issue33

[issue42033] Seemingly unnecessary complexification of foo(**kw)

2020-10-15 Thread Mark Shannon
Mark Shannon added the comment: Have you observed any slowdown or incorrect behaviour? The 3.8 bytecode looks incorrect to me. The C-API documentation doesn't prohibit callables from mutating the dictionary they receive. Unless a copy is made, then a callee could mutate `var`. https

[issue41756] Do not always use exceptions to return result from coroutine

2020-10-11 Thread Mark Shannon
Mark Shannon added the comment: What's the difference between removing it and making it properly private (i.e. static)? It's an irrelevant detail whether the code is inlined or in a helper function. -- ___ Python tracker <https://bugs.python.

[issue41756] Do not always use exceptions to return result from coroutine

2020-10-10 Thread Mark Shannon
Mark Shannon added the comment: Vladimir, Thanks for adding PyIter_Send(). Don't forget to remove PyGen_Send() :) -- ___ Python tracker <https://bugs.python.org/issue41

[issue41670] ceval traces code differently with USE_COMPUTED_GOTOS

2020-09-29 Thread Mark Shannon
Mark Shannon added the comment: New changeset 17b5be0c0a3f74141014e06a660f1b5ddb002fec by Mark Shannon in branch 'master': bpo-41670: Remove outdated predict macro invocation. (GH-22026) https://github.com/python/cpython/commit/17b5be0c0a3f74141014e06a660f1b5ddb002fec

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-25 Thread Mark Shannon
Mark Shannon added the comment: New changeset 02d126aa09d96d03dcf9c5b51c858ce5ef386601 by Mark Shannon in branch 'master': bpo-39934: Account for control blocks in 'except' in compiler. (GH-22395) https://github.com/python/cpython/commit/02d126aa09d96d03dcf9c5b51c858ce5ef386601

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +21435 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22395 ___ Python tracker <https://bugs.python.org/issu

[issue39934] Fatal Python error "XXX block stack overflow" when exception stacks >10

2020-09-24 Thread Mark Shannon
Mark Shannon added the comment: iritkatriel What error do you see and on what version? -- ___ Python tracker <https://bugs.python.org/issue39934> ___ ___ Pytho

[issue41845] Promote PyObject_GenericGetDict to the stable API

2020-09-23 Thread Mark Shannon
Mark Shannon added the comment: It wasn't removed in 7d95e4072169911b228c9e42367afb5f17fd3db0, just moved from object.h to dictobject.h It was still part of the API at that point, I think. -- ___ Python tracker <https://bugs.python.org/issue41

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-09-23 Thread Mark Shannon
Mark Shannon added the comment: Thanks Victor. Sorry I didn't get round to this sooner -- ___ Python tracker <https://bugs.python.org/issue40941> ___ ___ Pytho

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-09-21 Thread Mark Shannon
Mark Shannon added the comment: I can't resist the pun on typing. `type(...)` is the least typing :) More seriously, >From a general consistency point of view, if this is to be added, shouldn't `types.NoneType` and `types.NotImplementedType` be added as well? -- nosy: +Mark.Shan

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-21 Thread Mark Shannon
Mark Shannon added the comment: Yury, Why was the PR merged with a new API function `PyGen_Send`? I explicitly said that any new API function should *not* start with `PyGen`, nor should any function rely on generators and async "coroutines" sharing the same memory layout. If yo

[issue41756] Do not always use exceptions to return result from coroutine

2020-09-17 Thread Mark Shannon
Mark Shannon added the comment: I agree with Serhiy, that `PyGen_` is a bad prefix. Unless a function takes generator objects and *only* generators objects, then it shouldn't have a `PyGen` prefix. The API function is the C equivalent of obj.send(val). The first parameter is an object

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-09 Thread Mark Shannon
Mark Shannon added the comment: Thanks for the reminder. Tis' done. -- stage: patch review -> ___ Python tracker <https://bugs.python.org/issue41703> ___ _

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-08 Thread Mark Shannon
Mark Shannon added the comment: The change note for 33387 incorrectly referred to 32949 -- stage: patch review -> ___ Python tracker <https://bugs.python.org/issu

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-08 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +21232 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22151 ___ Python tracker <https://bugs.python.org/issu

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-08 Thread Mark Shannon
Mark Shannon added the comment: https://bugs.python.org/issue39320 has a change note: https://docs.python.org/3.9/whatsnew/changelog.html#python-3-9-0-beta-3 -- ___ Python tracker <https://bugs.python.org/issue41

[issue41703] Most bytecode changes are absent from Python 3.9 What's new

2020-09-08 Thread Mark Shannon
Change by Mark Shannon : -- assignee: -> Mark.Shannon ___ Python tracker <https://bugs.python.org/issue41703> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue41670] ceval traces code differently with USE_COMPUTED_GOTOS

2020-08-31 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +21126 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22026 ___ Python tracker <https://bugs.python.org/issu

[issue41670] ceval traces code differently with USE_COMPUTED_GOTOS

2020-08-31 Thread Mark Shannon
Mark Shannon added the comment: A couple of things to fix here. Firstly, the PREDICTion of POP_BLOCK in FOR_ITER shouldn't be there. POP_BLOCK doesn't normally occur after a loop and hasn't since we removed "pseudo exceptions" from the interpreter a couple of years ago.

[issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter

2020-08-13 Thread Mark Shannon
Mark Shannon added the comment: @hroncok, How did you discover this issue? I'd like to clean up the code for creating dictionary literals and it might be helpful to know where such huge dictionary literals exist. I'm guessing that they are used as lookup tables for things like Unicode code

[issue41531] Python 3.9 regression: Literal dict with > 65535 items are one item shorter

2020-08-13 Thread Mark Shannon
Mark Shannon added the comment: New changeset c51db0ea40ddabaf5f771ea633b37fcf4c90a495 by Pablo Galindo in branch 'master': bpo-41531: Fix compilation of dict literals with more than 0x elements (GH-21850) https://github.com/python/cpython/commit/c51db0ea40ddabaf5f771ea633b37fcf4c90a495

[issue41463] Avoid duplicating jump information from opcode.py in compile.c

2020-08-04 Thread Mark Shannon
Mark Shannon added the comment: New changeset 582aaf19e8b94a70c1f96792197770d604ba0fdf by Mark Shannon in branch 'master': bpo-41463: Generate information about jumps from 'opcode.py' rather than duplicating it in 'compile.c' (GH-21714) https://github.com/python/cpython/commit

[issue41463] Avoid duplicating jump information from opcode.py in compile.c

2020-08-03 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +20858 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21714 ___ Python tracker <https://bugs.python.org/issu

[issue41463] Avoid duplicating jump information from opcode.py in compile.c

2020-08-03 Thread Mark Shannon
New submission from Mark Shannon : opcode.py declares which jumps are relative and which are absolute. We duplicate that information in compile.c We should generate lookup tables in opcodes.h and to repeating that information in compile.c -- messages: 374735 nosy: Mark.Shannon

[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-30 Thread Mark Shannon
Mark Shannon added the comment: New changeset 6e8128f02e1d36e38e5866f9dc36e051caa47bc9 by Mark Shannon in branch 'master': bpo-41323: Perform 'peephole' optimizations directly on the CFG. (GH-21517) https://github.com/python/cpython/commit/6e8128f02e1d36e38e5866f9dc36e051caa47bc9

[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-30 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-07-17 Thread Mark Shannon
Mark Shannon added the comment: New changeset cb9879b948a19c9434316f8ab6aba9c4601a8173 by Mark Shannon in branch 'master': bpo-40941: Unify implicit and explicit state in the frame and generator objects into a single value. (GH-20803) https://github.com/python/cpython/commit

[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-17 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +20653 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/21517 ___ Python tracker <https://bugs.python.org/issu

[issue41323] Perform "peephole" optimization directly on control-flow graph.

2020-07-17 Thread Mark Shannon
New submission from Mark Shannon : Currently we perform various bytecode improvements as a pass on the code objects after generating the code object. This requires parsing the bytecode to find instructions, recreating the CFG, and rewriting the line number table. If we perform

[issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw()

2020-07-09 Thread Mark Shannon
Mark Shannon added the comment: New changeset 8b33961e4bc4020d8b2d5b949ad9d5c669300e89 by Chris Jerdonek in branch 'master': bpo-29590: fix stack trace for gen.throw() with yield from (#19896) https://github.com/python/cpython/commit/8b33961e4bc4020d8b2d5b949ad9d5c669300e89 -- nosy

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-07-09 Thread Mark Shannon
Mark Shannon added the comment: issue29590 is unrelated -- ___ Python tracker <https://bugs.python.org/issue40941> ___ ___ Python-bugs-list mailing list Unsub

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-13 Thread Mark Shannon
Mark Shannon added the comment: Dennis, thanks for doing the benchmarking. You seem to have removed rather more macros than I suggested, but it probably won't make much difference to the results. Since this may have a negative effect on performance and doesn't seem to be popular, let's drop

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-13 Thread Mark Shannon
Change by Mark Shannon : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue40925> ___ ___ Pyth

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-06-11 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +1 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20803 ___ Python tracker <https://bugs.python.org/issu

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-06-11 Thread Mark Shannon
Mark Shannon added the comment: This change combines the explicit state in `PyFrameObject.f_excuting` and `PyGenObject.gi_running`, and the implicit state in `PyFrameObject.f_stacktop == NULL` and `PyFrameObject.f_last == -1` into a single enum field in `PyFrameObject`. Since we no longer

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-11 Thread Mark Shannon
Mark Shannon added the comment: New changeset 33faf5c4f43e24766cf567bec89ad4c7f1491ff7 by Dong-hee Na in branch 'master': bpo-40925: Remove unused stack macro SET_VALUE (GH-20783) https://github.com/python/cpython/commit/33faf5c4f43e24766cf567bec89ad4c7f1491ff7

[issue40941] Merge generator.gi_running and frame executing flag into single frame state

2020-06-10 Thread Mark Shannon
New submission from Mark Shannon : Generators have a "gi_running" attribute (coroutines have an equivalent cr_running flag). Internally frame also has an executing flag. We use these, plus the test `f_stacktop pointer == NULL`, to determine what state a generator or frame is in.

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-10 Thread Mark Shannon
Mark Shannon added the comment: I'm proposing that we remove the nine macros above; the eleven listed, except TOP() and SECOND(). They can be replaced by POP(), PUSH() and PEEK() without lost of functionality or performance. -- ___ Python tracker

[issue40925] Remove redundant macros used for stack manipulation in interpreter

2020-06-09 Thread Mark Shannon
New submission from Mark Shannon : Currently, there are fourteen macros provided for stack manipulation. Along with the fundamental, POP(), PUSH() and PEEK(n) the following eleven are also provided: TOP() SECOND() THIRD() FOURTH() SET_TOP(v) SET_SECOND(v

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-08 Thread Mark Shannon
Mark Shannon added the comment: I'd be interested to see if you can get more consistent results. Performance of modern hardware is very sensitive to memory layout, so some sort of address randomization might be needed to remove artifacts of layout. It is possible that the objects on the free

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2020-06-05 Thread Mark Shannon
Mark Shannon added the comment: I'm worried about the performance impact of these changes, especially as many of the changes haven't been reviewed. Have you done any performance analysis or tests of the cumulative effect of all these changes? -- nosy: +Mark.Shannon

[issue40830] Certain uses of dictionary unpacking raise TypeError

2020-05-31 Thread Mark Shannon
Change by Mark Shannon : -- keywords: -patch ___ Python tracker <https://bugs.python.org/issue40830> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40830] Certain uses of dictionary unpacking raise TypeError

2020-05-31 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +19796 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/20553 ___ Python tracker <https://bugs.python.org/issu

[issue29882] Add an efficient popcount method for integers

2020-05-31 Thread Mark Shannon
Mark Shannon added the comment: Why are calling a population count method "bit_count()"? That seems likely to cause confusion with "bit_length()". I might reasonable expect that 0b1000.bit_count() be 4, not 1. It does have 4 bits. Whereas 0b1000.population_count() i

[issue40830] Certain uses of dictionary unpacking raise TypeError

2020-05-30 Thread Mark Shannon
Mark Shannon added the comment: Thanks for the report. I'm looking in to it. -- assignee: -> Mark.Shannon priority: normal -> release blocker stage: -> needs patch ___ Python tracker <https://bugs.python.or

[issue40728] UnboundLocalError as a result of except statement variable re-assignment

2020-05-22 Thread Mark Shannon
Mark Shannon added the comment: Oleksandr, Are you saying that the current behaviour is incorrect, in the sense that it disagrees with the documentation? Or are you saying that the current behaviour is undesirable? -- ___ Python tracker <ht

[issue39511] [subinterpreters] Per-interpreter singletons (None, True, False, etc.)

2020-05-15 Thread Mark Shannon
Mark Shannon added the comment: Those numbers are for code without immortal objects. They don't apply in this case, as the branch misprediction rate would rise. -- ___ Python tracker <https://bugs.python.org/issue39

[issue40545] Expose _PyErr_GetTopmostException

2020-05-07 Thread Mark Shannon
Mark Shannon added the comment: Why do you need to specify a `PyThreadState`? -- ___ Python tracker <https://bugs.python.org/issue40545> ___ ___ Python-bug

[issue40421] [C API] Add getter functions for PyFrameObject and maybe move PyFrameObject to the internal C API

2020-05-07 Thread Mark Shannon
Mark Shannon added the comment: "maybe a few setter functions as well" Please don't add any setter functions, that would a major change to the VM and would need a PEP. Also, could you remove PyFrame_GetLastInstr(PyFrameObject *frame)? The only purpose of `f_lasti` is to get the l

[issue40545] Expose _PyErr_GetTopmostException

2020-05-07 Thread Mark Shannon
Mark Shannon added the comment: What's wrong with `PyErr_GetExcInfo()` for accessing the current exception? Victor, would you revert https://github.com/python/cpython/pull/19978 until we decide what to do. Thanks. -- ___ Python tracker <ht

[issue40228] Make setting line number in frame more robust.

2020-05-07 Thread Mark Shannon
Change by Mark Shannon : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue40228] Make setting line number in frame more robust.

2020-04-29 Thread Mark Shannon
Mark Shannon added the comment: New changeset 57697245e1deafdedf68e5f21ad8890be591efc0 by Mark Shannon in branch 'master': bpo-40228: More robust frame.setlineno. (GH-19437) https://github.com/python/cpython/commit/57697245e1deafdedf68e5f21ad8890be591efc0

[issue40255] Fixing Copy on Writes from reference counting

2020-04-20 Thread Mark Shannon
Mark Shannon added the comment: On 20/04/2020 2:33 pm, Steve Dower wrote: > > Steve Dower added the comment: > >> I would expect that the negative impact on branch predictability would >> easily outweigh the cost of the memory write (A guaranteed L1 hit) > > If

[issue40255] Fixing Copy on Writes from reference counting

2020-04-20 Thread Mark Shannon
Mark Shannon added the comment: Eddie, How did you compare the branching vs. non-branching implementations? I have read the code in the PR. What is the non-branching version that you used to compare it against? Why not use the sign bit as the immortal bit? It simplifies the test

[issue40255] Fixing Copy on Writes from reference counting

2020-04-16 Thread Mark Shannon
Mark Shannon added the comment: Do you have more details on your comparison? I'm somewhat puzzled how a version that does no more work and has no jumps is slower. The memory hit is not immediate, but making the object header immutable prevents changes like https://github.com/markshannon

[issue40255] Fixing Copy on Writes from reference counting

2020-04-16 Thread Mark Shannon
Mark Shannon added the comment: A big -1 to this. You are asking the whole world to take a hit on both performance and memory use, in order to save Instagram memory. The PR uses the term "immortal" everywhere. There is only one reference to copy-on-write in a comment. Yet this i

[issue40225] recursive call within generator expression is O(depth)

2020-04-11 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +18828 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19473 ___ Python tracker <https://bugs.python.org/issu

[issue40225] recursive call within generator expression is O(depth)

2020-04-11 Thread Mark Shannon
Mark Shannon added the comment: The problem is that generators always raise an exception, even when they terminate normally. They don't in 2.7 and didn't prior to https://github.com/python/cpython/commit/1f7ce62bd61488d5d721896a36a1b43befab88b5#diff-23c87bfada1d01335a3019b9321502a0

[issue40228] Make setting line number in frame more robust.

2020-04-08 Thread Mark Shannon
Change by Mark Shannon : -- keywords: +patch pull_requests: +18791 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19437 ___ Python tracker <https://bugs.python.org/issu

[issue40228] Make setting line number in frame more robust.

2020-04-08 Thread Mark Shannon
New submission from Mark Shannon : Debuggers are allowed to change the line number of the currently executing frame. Regardless of whether this is sensible or not, the current implementation rather fragile. The code makes various assumptions about the layout of the bytecode that may

[issue40222] "Zero cost" exception handling

2020-04-08 Thread Mark Shannon
New submission from Mark Shannon : C++ and Java support what is known as "zero cost" exception handling. The "zero cost" refers to the cost when no exception is raised. There is still a cost when exceptions are thrown. The basic principle is that the compiler generates tab

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2020-03-31 Thread Mark Shannon
Mark Shannon added the comment: You can't end up with a growing set of keys. The problem is to do with the *order* of insertion, not the number of keys. -- ___ Python tracker <https://bugs.python.org/issue40

[issue40116] Regression in memory use of shared key dictionaries for "compact dicts"

2020-03-30 Thread Mark Shannon
Mark Shannon added the comment: Just to clarify. class AlwaysShared: opt = DEFAULT def __init__(self, attr, optional=None): self.attr = attr if optional: self.opt = optional class SometimesShared: opt = DEFAULT def __init__(self, attr, optional=None

<    4   5   6   7   8   9   10   11   12   >