New submission from Brandt Bucher :
I'm specifically concerned about Greenlet here (since it's a dependency of
pyperformance), but this discussion is equally relevant to any library like it
that dynamically swaps out the currently executing frame.
CPython 3.11 makes several major
Change by Brandt Bucher :
--
pull_requests: +28348
pull_request: https://github.com/python/cpython/pull/30129
___
Python tracker
<https://bugs.python.org/issue45
Brandt Bucher added the comment:
Interesting idea!
> It is likely that programs will have more than 2**16 functions versions, but
> it is much less likely that they will have more than 2**16 versions of
> special methods.
Is it? The pyperformance suite isn't exactly represen
Brandt Bucher added the comment:
Ah, never mind, I think I understand what you meant. Special methods get
0x0001-0x, all other functions get 0x0001-0x. So we use 16-bit
versions for special method caches, and 32-bit versions for normal call caches.
"super().__init__()
Brandt Bucher added the comment:
I'm going to take a stab at making this work today. The idea is to do something
like this when setting a new frame:
- Clear and pop tstate->cframe->current_frame and all of its linked
predecessors.
- These should all belong to the same CF
Brandt Bucher added the comment:
Also, it appears that in earlier versions of CPython, it was okay to set
tstate->frame = NULL. Some of Greenlet's tests *seem* to be doing this
(although it also possible that my current scaffolding has just broken
Greenlet).
Does anybody know off
Brandt Bucher added the comment:
Fixing this actually ended up being a lot simpler than I anticipated (and it
requires no changes on our end). All that's really required is saving and
restoring:
- tstate->cframe->current_frame
- tstate->datastack_chunk
- tstate->datas
Brandt Bucher added the comment:
After further discussion with the team this morning, we decided that the
proposed "dummy chunk" workaround is unacceptable (the interpreter may end up
trying free it when shutting down a thread).
Allowing the tstate->datastack_* members to be
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +28455
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30234
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Brandt Bucher added the comment:
New changeset 77195cd44b2506cda88a3cfc98918526068b1d46 by Brandt Bucher in
branch 'main':
bpo-46090: Allow PyThreadState.datastack_* members to be NULL (GH-30234)
https://github.com/python/cpython/commit/77195cd44b2506cda88a3cfc989185
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46202>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +28580
pull_request: https://github.com/python/cpython/pull/30367
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 10.0 -> 11.0
pull_requests: +28584
pull_request: https://github.com/python/cpython/pull/30372
___
Python tracker
<https://bugs.python.org/issu
Brandt Bucher added the comment:
New changeset 31e43cbe5f01cdd5b5ab330ec3040920e8b61a91 by Brandt Bucher in
branch 'main':
bpo-46009: Remove GEN_START (GH-30367)
https://github.com/python/cpython/commit/31e43cbe5f01cdd5b5ab330ec30409
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46329>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brandt Bucher :
To my surprise, it seems that it's possible to create "small" integers that
should live in _PyLong_SMALL_INTS, but don't. Here are two examples I've found:
>>> import decimal
>>> i = int(decimal.Decimal(42)) # Mo
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +28781
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30583
___
Python tracker
<https://bugs.python.org/issu
Brandt Bucher added the comment:
The attached PR doesn't seem to have any impact on Decimal performance
(non-optimized, non-debug build on a fairly quiet laptop):
main:
Convert 262,000 Decimals to "small" ints: 31.7 ms +- 5.3 ms
Convert 256,000 Decimals to 1-digit ints: 29
New submission from Brandt Bucher :
The performance of our existing int and float specializations can be improved
by mutating the LHS operand in-place when possible. This leads to significant
speedups for several number-crunching benchmarks, and a solid 1% improvement
overall:
Slower (16
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +28792
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30594
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46376>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46378>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brandt Bucher :
...as discussed in https://github.com/faster-cpython/ideas/discussions/228.
We can dramatically simplify our stack manipulations by getting rid of the
`DUP_TOP*` and `ROT_*` families of instructions:
- Replace `DUP_TOP` with `COPY(1)`.
- Replace
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +29081
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/30902
___
Python tracker
<https://bugs.python.org/issu
Brandt Bucher added the comment:
In practice, pretty much the only thing that will do more work now is augmented
subscription:
>>> a[b] += c
main:
1 2 LOAD_NAME0 (a)
4 LOAD_NAME1 (b)
6 DUP_TOP_TWO
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46465>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue33205>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue42926>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
New changeset 85483668647e7840c7b9a1877caaf2ef14a4443f by Brandt Bucher in
branch 'main':
bpo-46528: Simplify the VM's stack manipulations (GH-30902)
https://github.com/python/cpython/commit/85483668647e7840c7b9a1877
Change by Brandt Bucher :
--
pull_requests: +29148
pull_request: https://github.com/python/cpython/pull/30970
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
In a typical run of the pyperformance benchmark suite, rotations account for a
bit over 1% of all instructions executed.
I don't have timings for individual instructions, unfortunately.
--
___
Python tr
Brandt Bucher added the comment:
> I did an experiment to double the number of instructions.
Were the extra instructions just NOPs, or were they actually doing any work?
If they were NOPs, then presumably those numbers tell us more about the
overhead of dispatch and cache pressure t
Brandt Bucher added the comment:
Hm, yeah. Bummer that this needs error handling now.
I'll have a fix up soon.
--
___
Python tracker
<https://bugs.python.org/is
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +29179
pull_request: https://github.com/python/cpython/pull/30998
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
pull_requests: +29180
pull_request: https://github.com/python/cpython/pull/30998
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
pull_requests: -29179
___
Python tracker
<https://bugs.python.org/issue45628>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: -brandtbucher
___
Python tracker
<https://bugs.python.org/issue45628>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
Any chance we could revert the recent renaming of tstate.exc_state and
tstate.root_cframe in https://github.com/python/cpython/pull/30590? It broke
Greenlet again:
https://github.com/python-greenlet/greenlet/issues/288
If it's only a name change (an
Change by Brandt Bucher :
--
pull_requests: +29222
pull_request: https://github.com/python/cpython/pull/31039
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
New changeset a0e55a571cf01885fd5826266c37abaee307c309 by Brandt Bucher in
branch 'main':
bpo-46528: Simplify BUILD_TUPLE/UNPACK_SEQUENCE folding (GH-31039)
https://github.com/python/cpython/commit/a0e55a571cf01885fd5826266c37ab
Brandt Bucher added the comment:
My fix for this seems to have erroneously added two invalid new jump threads:
POP_JUMP_IF_FALSE(a) to JUMP_IF_FALSE_OR_POP(b) is folded into
POP_JUMP_IF_FALSE(b)
POP_JUMP_IF_TRUE(a) to JUMP_IF_TRUE_OR_POP(b) is folded into POP_JUMP_IF_TRUE(b)
The good news
Change by Brandt Bucher :
--
pull_requests: +29251
pull_request: https://github.com/python/cpython/pull/31066
___
Python tracker
<https://bugs.python.org/issue45
Change by Brandt Bucher :
--
priority: release blocker ->
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python
Brandt Bucher added the comment:
New changeset 46328d8ae6529db916ccaabb9247fb0327ce0c1e by Brandt Bucher in
branch 'main':
bpo-46528: Check PyMem_Malloc for NULL (GH-30998)
https://github.com/python/cpython/commit/46328d8ae6529db916ccaabb9247fb
Brandt Bucher added the comment:
New changeset 78ae4cc6dc949e8bc39fab25fea5efe983dc0ad1 by Brandt Bucher in
branch 'main':
bpo-46528: Attempt SWAPs at compile-time (GH-30970)
https://github.com/python/cpython/commit/78ae4cc6dc949e8bc39fab25fea5ef
Change by Brandt Bucher :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
New submission from Brandt Bucher :
UNPACK_SEQUENCE already has fast paths for tuples and lists, which make up
(literally) 99% of unpackings in the benchmark suite. What's more, two-element
tuples make up about two-thirds of all unpackings (though I actually suspect
it's even hig
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +29410
pull_request: https://github.com/python/cpython/pull/31240
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
(I also plan on looking into an adaptive super-duper-instruction for
UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST after the current PR has
landed).
--
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +29413
pull_request: https://github.com/python/cpython/pull/31244
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 2.0 -> 3.0
pull_requests: +29449
pull_request: https://github.com/python/cpython/pull/31289
___
Python tracker
<https://bugs.python.org/issu
Brandt Bucher added the comment:
New changeset a9da085015db8cbb81f660158864ac94fe6c67a2 by Brandt Bucher in
branch 'main':
bpo-46702: Specialize UNPACK_SEQUENCE (GH-31240)
https://github.com/python/cpython/commit/a9da085015db8cbb81f660158864ac
Brandt Bucher added the comment:
New changeset 580cd9ab2992b7df6f4815020b5841e14a5a6977 by Brandt Bucher in
branch 'main':
bpo-46072: Add detailed failure stats for BINARY_OP (GH-31289)
https://github.com/python/cpython/commit/580cd9ab2992b7df6f4815020b5841
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46748>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
Closing as UNPACK_SEQUENCE_TWO_TUPLE__STORE_FAST__STORE_FAST results in lots of
hits, but no performance improvement.
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
_
Change by Brandt Bucher :
--
pull_requests: +29638
pull_request: https://github.com/python/cpython/pull/31511
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 2.0 -> 3.0
pull_requests: +29643
pull_request: https://github.com/python/cpython/pull/31516
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +29644
pull_request: https://github.com/python/cpython/pull/31517
___
Python tracker
<https://bugs.python.org/issu
Brandt Bucher added the comment:
New changeset 281ea9c39146a00cdf3fa2b3d0be60e2a39278ce by Brandt Bucher in
branch 'main':
bpo-44337: Shrink the LOAD_ATTR/STORE_ATTR caches (GH-31517)
https://github.com/python/cpython/commit/281ea9c39146a00cdf3fa2b3d0be60
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46754>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue45107>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46823>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Brandt Bucher :
...as discussed in https://github.com/faster-cpython/ideas/discussions/263.
My plan is for this initial PR to lay the groundwork, then to work on porting
over the existing opcode caches one-by-one. Once that's done, we can clean up
lots of the
Change by Brandt Bucher :
--
keywords: +patch
pull_requests: +29666
pull_request: https://github.com/python/cpython/pull/31543
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue45431>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46808>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46850>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46836>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
pull_requests: +29714
pull_request: https://github.com/python/cpython/pull/31591
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
pull_requests: +29747
pull_request: https://github.com/python/cpython/pull/31622
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
Victor, can we please revert these changes? They broke Greenlet, a required
dependency for three of our performance benchmarks:
https://github.com/python-greenlet/greenlet/issues/288#issuecomment-1055632607
I've already spent considerable effort contrib
Brandt Bucher added the comment:
I'm also very uncomfortable with the lack of review on these PRs. The most
recent one (https://github.com/python/cpython/pull/31583) was open for less
than 30 minutes before merging, from 6:57 to 7:22 am in my local time
Change by Brandt Bucher :
--
pull_requests: +29761
pull_request: https://github.com/python/cpython/pull/31640
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
> What I *think* is happening is that the inline cache takes the size of the
> function (in code units) from about 4800 to about 5200, crossing our
> threshold for quickening (currently set to 5000).
Yep, nailed it:
>>> len(list(di
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46864>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
pull_requests: +29782
pull_request: https://github.com/python/cpython/pull/31663
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46908>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
New changeset 127797f572cc7374192e415c44ea2e95b009d5ab by Brandt Bucher in
branch 'main':
bpo-46841: Improve the failure stats for COMPARE_OP (GH-31663)
https://github.com/python/cpython/commit/127797f572cc7374192e415c44ea2e
Brandt Bucher added the comment:
Reopening since this needed to be removed for
https://github.com/python/cpython/pull/31640.
--
resolution: fixed ->
stage: resolved ->
status: closed -> open
___
Python tracker
<https://bug
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46896>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
> CPython will track only one global callback; it is a well-behaved client’s
> responsibility to check if a callback is already set when setting a new one,
> and daisy-chain to the previous callback if so.
Hm, this is a bit scary. Could we (or other
Brandt Bucher added the comment:
Also, when you say "only one global callback": does that mean per-interpreter,
or per-process?
--
___
Python tracker
<https://bugs.python.o
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue40421>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue44800>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Brandt Bucher :
--
pull_requests: +29783
pull_request: https://github.com/python/cpython/pull/31664
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
pull_requests: +29791
pull_request: https://github.com/python/cpython/pull/31671
___
Python tracker
<https://bugs.python.org/issue46
Brandt Bucher added the comment:
New changeset 05a8bc1c944709e7468f157bd1b6032f368e43bf by Brandt Bucher in
branch 'main':
bpo-46841: Use inline caching for attribute accesses (GH-31640)
https://github.com/python/cpython/commit/05a8bc1c944709e7468f157bd1b603
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46923>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
> Why so coarse?
> Getting a notification for every change of a global in module, is likely to
> make use the use of global variables extremely expensive.
Perhaps a compromise is possible here: one global group/chain of callbacks
registere
Brandt Bucher added the comment:
New changeset c4d2d57eefb1224a12e2e95e4508658dfbf6a7c9 by Brandt Bucher in
branch 'main':
bpo-46841: Fix BINARY_OP's handling of inline caches (GH-31671)
https://github.com/python/cpython/commit/c4d2d57eefb1224a12e2e95e4
Change by Brandt Bucher :
--
pull_requests: +29828
pull_request: https://github.com/python/cpython/pull/31709
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46939>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
New changeset f193631387bfee99a812e39b05d5b7e6384b57f5 by Brandt Bucher in
branch 'main':
bpo-46841: Use inline caching for calls (GH-31709)
https://github.com/python/cpython/commit/f193631387bfee99a812e39b05d5b7
Change by Brandt Bucher :
--
pull_requests: +29859
pull_request: https://github.com/python/cpython/pull/31742
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46961>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
Related, except this seems to be happening in long_pow. I’ll take a look at it
today.
--
assignee: -> brandtbucher
___
Python tracker
<https://bugs.python.org/issu
Change by Brandt Bucher :
--
pull_requests: +29886
pull_request: https://github.com/python/cpython/pull/31780
___
Python tracker
<https://bugs.python.org/issue46
Change by Brandt Bucher :
--
nosy: +brandtbucher
___
Python tracker
<https://bugs.python.org/issue46965>
___
___
Python-bugs-list mailing list
Unsubscribe:
Brandt Bucher added the comment:
New changeset a89c29fbcc7e7e85848499443d819c3fab68c78a by Brandt Bucher in
branch 'main':
bpo-46841: Add a _Py_SET_OPCODE macro (GH-31780)
https://github.com/python/cpython/commit/a89c29fbcc7e7e85848499443d819c
1 - 100 of 543 matches
Mail list logo