Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Mark Shannon added the comment:
Duplicate of 42500
--
nosy: +Mark.Shannon
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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:/
Change by Mark Shannon :
--
pull_requests: +22384
pull_request: https://github.com/python/cpython/pull/23495
___
Python tracker
<https://bugs.python.org/issue42
Mark Shannon added the comment:
https://github.com/python/peps/pull/1722/
--
___
Python tracker
<https://bugs.python.org/issue42373>
___
___
Python-bugs-list m
Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
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
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
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
Change by Mark Shannon :
--
pull_requests: +22153
pull_request: https://github.com/python/cpython/pull/23256
___
Python tracker
<https://bugs.python.org/issue42
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
Change by Mark Shannon :
--
pull_requests: +22148
pull_request: https://github.com/python/cpython/pull/23251
___
Python tracker
<https://bugs.python.org/issue42
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
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
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
Change by Mark Shannon :
--
nosy: +nedbat
___
Python tracker
<https://bugs.python.org/issue42246>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
Mark Shannon added the comment:
Thanks Neil
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Change by Mark Shannon :
--
pull_requests: +21825
pull_request: https://github.com/python/cpython/pull/22893
___
Python tracker
<https://bugs.python.org/issue42
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
Mark Shannon added the comment:
Yes, thanks for pointing that out.
--
___
Python tracker
<https://bugs.python.org/issue33387>
___
___
Python-bugs-list mailin
Change by Mark Shannon :
--
pull_requests: +21689
pull_request: https://github.com/python/cpython/pull/22723
___
Python tracker
<https://bugs.python.org/issue33
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
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.
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
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
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
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
Mark Shannon added the comment:
iritkatriel
What error do you see and on what version?
--
___
Python tracker
<https://bugs.python.org/issue39934>
___
___
Pytho
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
Mark Shannon added the comment:
Thanks Victor.
Sorry I didn't get round to this sooner
--
___
Python tracker
<https://bugs.python.org/issue40941>
___
___
Pytho
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
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
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
Mark Shannon added the comment:
Thanks for the reminder. Tis' done.
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issue41703>
___
_
Mark Shannon added the comment:
The change note for 33387 incorrectly referred to 32949
--
stage: patch review ->
___
Python tracker
<https://bugs.python.org/issu
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
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
Change by Mark Shannon :
--
assignee: -> Mark.Shannon
___
Python tracker
<https://bugs.python.org/issue41703>
___
___
Python-bugs-list mailing list
Unsubscrib
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
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.
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
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
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
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
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
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
Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
Mark Shannon added the comment:
issue29590 is unrelated
--
___
Python tracker
<https://bugs.python.org/issue40941>
___
___
Python-bugs-list mailing list
Unsub
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
Change by Mark Shannon :
--
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue40925>
___
___
Pyth
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
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
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
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.
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
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
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
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
Change by Mark Shannon :
--
keywords: -patch
___
Python tracker
<https://bugs.python.org/issue40830>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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
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
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
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
Mark Shannon added the comment:
Why do you need to specify a `PyThreadState`?
--
___
Python tracker
<https://bugs.python.org/issue40545>
___
___
Python-bug
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
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
Change by Mark Shannon :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
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
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
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
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
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
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
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
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
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
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
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
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
801 - 900 of 1194 matches
Mail list logo