Skip to content

Keep PyLong loop carries as twodigits in shifts #156443

Description

@XiaohongGong

Feature or enhancement

Proposal:

Several functions in longobject.c (v_lshift, v_rshift, and x_divrem) narrowed a loop carry value to digit or sdigit, then widened it again on the next iteration.

On AArch64, that 64-to-32-to-64 conversion inserts an extra mov on the loop-carried critical path. Keeping the carry at two-digit width until the function returns drops that mov and shortens the carry chain. Results are unchanged for valid limbs.

Use v_lshift on AArch64 as an example. The code inside the loop is:

  ldr  w0, [x4, x2, lsl #2]    ; a[i]
  mov  w3, w3                  ; carry chain
  lsl  x0, x0, x24             ; a[i] << d
  orr  x0, x0, x3              ; carry chain
  and  w1, w0, #0x3fffffff
  ubfx x3, x0, #30, #32        ; carry chain
  str  w1, [x26, x2, lsl #2]
  add  x2, x2, #1
  cmp  x25, x2
  b.ne

removing the narrowing, the code will be optimized to:

  ldr  w0, [x4, x2, lsl #2]    ; a[i]
  lsl  x0, x0, x24             ; a[i] << d
  orr  x0, x0, x3              ; carry chain
  and  w1, w0, #0x3fffffff
  str  w1, [x26, x2, lsl #2]
  add  x2, x2, #1
  lsr  x3, x0, #30             ; carry chain
  cmp  x25, x2
  b.ne

The instruction count on the loop carried chain is reduced from 3 to 2.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    performancePerformance or resource usage
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on Aug 27, 2026
  2. aisk commented on Aug 27, 2026

    @aisk
    Member

    It would be good to have some benchmark numbers on both aarch64 and x86-64 before anyone starts on this.

  3. added
    pendingThe issue will be closed if no feedback is provided
    on Aug 27, 2026
  4. XiaohongGong commented on Aug 28, 2026

    @XiaohongGong
    Author

    It would be good to have some benchmark numbers on both aarch64 and x86-64 before anyone starts on this.

    Yeah, thanks for looking at this issue. I'm working on preparing the patch for improvement. And will publish the PR soon~

    We can observe ~20% performance gain for pidigits on an AArch64 machine, while about ~4% on a X86_64 machine. I will provide the performance details soon. Thanks!

  5. XiaohongGong commented on Sep 1, 2026

    @XiaohongGong
    Author

    Here is the performance-change graph for pyperformance on my x86 and AArch64 machines. It compares the normalized runtime before and after the change: values greater than 1 indicate a performance improvement, while values below 1 indicate a regression.

    AArch64 (NVIDIA Grace Neoverse-V2):

    Image

    X86 (AMD EPYC 9124 16-Core):

    Image

    From the above data, we can observe about 20% performance uplifts for pidigits on AArch64 while not significant regression on other benchmarks and on X86 machines.

  6. changed the title [-]Keep PyLong loop carry at two-digit width in shift and division[/-] [+]Keep PyLong loop carries as twodigits in shifts and division[/+] on Sep 7, 2026
  7. added a commit that references this issue on Sep 7, 2026
  8. removed
    pendingThe issue will be closed if no feedback is provided
    on Sep 7, 2026
  9. picnixz commented on Sep 7, 2026

    @picnixz
    Member

    From the above data, we can observe about 20% performance uplifts for pidigits on AArch64 while not significant regression on other benchmarks and on X86 machines.

    Please include the data as table with geometric mean as well (it's a bit hard to read the graph). In addition, x86 still see regressions of about 4% I guess which is non-negligible on macrobenchmarks.

  10. XiaohongGong commented on Sep 8, 2026

    @XiaohongGong
    Author

    Please include the data as table with geometric mean as well (it's a bit hard to read the graph). In addition, x86 still see regressions of about 4% I guess which is non-negligible on macrobenchmarks.

    There is a substantial amount of performance data, so I previously presented it as a graph. The data in table is shown below. For the roughly 3%–5% regressions observed in several benchmarks, I reran the tests multiple times but could not reproduce them consistently. This suggests that the regressions may be due to measurement noise rather than the change itself.

    Here is the pyperformance result on my AArch64 (NVIDIA Grace Neoverse-V2) machine:

    Benchmarks with tag 'apps':
    ===========================
    
    | Benchmark      | pyperf-base | pyperf                |
    |----------------|:-----------:|:---------------------:|
    | tornado_http   | 82.6 ms     | 81.8 ms: 1.01x faster |
    | Geometric mean | (ref)       | 1.00x faster          |
    
    Benchmark hidden because not significant (5): 2to3, chameleon, docutils, html5lib, sphinx
    
    Benchmarks with tag 'asyncio':
    ==============================
    
    | Benchmark                        | pyperf-base | pyperf               |
    |----------------------------------|:-----------:|:--------------------:|
    | async_tree_eager_cpu_io_mixed_tg | 324 ms      | 328 ms: 1.01x slower |
    | Geometric mean                   | (ref)       | 1.00x slower         |
    
    Benchmark hidden because not significant (20): async_generators, async_tree_none, async_tree_eager_io, async_tree_eager_io_tg, async_tree_eager_memoization_tg, async_tree_cpu_io_mixed, async_tree_eager_memoization, asyncio_websockets, asyncio_tcp_ssl, async_tree_cpu_io_mixed_tg, async_tree_eager, async_tree_eager_cpu_io_mixed, async_tree_eager_tg, async_tree_io, async_tree_memoization, async_tree_memoization_tg, asyncio_tcp, async_tree_io_tg, async_tree_none_tg, coroutines
    
    Benchmarks with tag 'math':
    ===========================
    
    | Benchmark      | pyperf-base | pyperf               |
    |----------------|:-----------:|:--------------------:|
    | pidigits       | 170 ms      | 141 ms: 1.21x faster |
    | Geometric mean | (ref)       | 1.04x faster         |
    
    Benchmark hidden because not significant (2): float, nbody
    
    Benchmarks with tag 'regex':
    ============================
    
    | Benchmark      | pyperf-base | pyperf                |
    |----------------|:-----------:|:---------------------:|
    | regex_v8       | 13.6 ms     | 14.2 ms: 1.05x slower |
    | Geometric mean | (ref)       | 1.01x slower          |
    
    Benchmark hidden because not significant (3): regex_compile, regex_effbot, regex_dna
    
    Benchmarks with tag 'serialize':
    ================================
    
    | Benchmark            | pyperf-base | pyperf                |
    |----------------------|:-----------:|:---------------------:|
    | unpickle_pure_python | 154 us      | 149 us: 1.04x faster  |
    | pickle_list          | 2.84 us     | 2.79 us: 1.02x faster |
    | pickle               | 7.35 us     | 7.25 us: 1.01x faster |
    | xml_etree_parse      | 107 ms      | 106 ms: 1.01x faster  |
    | ascii85_large        | 8.51 ms     | 8.42 ms: 1.01x faster |
    | json_dumps           | 5.43 ms     | 5.37 ms: 1.01x faster |
    | base85_large         | 3.14 ms     | 3.10 ms: 1.01x faster |
    | xml_etree_iterparse  | 74.8 ms     | 74.5 ms: 1.00x faster |
    | base64_large         | 1.71 ms     | 1.71 ms: 1.00x faster |
    | base32_large         | 1.95 ms     | 1.95 ms: 1.00x faster |
    | base32_small         | 194 us      | 194 us: 1.00x slower  |
    | base16_small         | 381 us      | 384 us: 1.01x slower  |
    | unpickle             | 8.25 us     | 8.37 us: 1.01x slower |
    | Geometric mean       | (ref)       | 1.00x faster          |
    
    Benchmark hidden because not significant (12): tomli_loads, base64_small, base85_small, unpickle_list, ascii85_small, xml_etree_process, pickle_dict, pickle_pure_python, urlsafe_base64_small, json_loads, xml_etree_generate, base16_large
    
    Benchmarks with tag 'startup':
    ==============================
    
    | Benchmark              | pyperf-base | pyperf                |
    |------------------------|:-----------:|:---------------------:|
    | python_startup_no_site | 6.13 ms     | 6.07 ms: 1.01x faster |
    | python_startup         | 10.0 ms     | 9.97 ms: 1.01x faster |
    | Geometric mean         | (ref)       | 1.01x faster          |
    
    Benchmarks with tag 'template':
    ===============================
    
    Benchmark hidden because not significant (2): django_template, mako
    
    All benchmarks:
    ===============
    
    | Benchmark                        | pyperf-base | pyperf                 |
    |----------------------------------|:-----------:|:----------------------:|
    | pidigits                         | 170 ms      | 141 ms: 1.21x faster   |
    | unpickle_pure_python             | 154 us      | 149 us: 1.04x faster   |
    | logging_format                   | 4.36 us     | 4.23 us: 1.03x faster  |
    | sqlalchemy_imperative            | 7.21 ms     | 7.06 ms: 1.02x faster  |
    | richards_super                   | 34.5 ms     | 33.8 ms: 1.02x faster  |
    | pickle_list                      | 2.84 us     | 2.79 us: 1.02x faster  |
    | pickle                           | 7.35 us     | 7.25 us: 1.01x faster  |
    | xml_etree_parse                  | 107 ms      | 106 ms: 1.01x faster   |
    | ascii85_large                    | 8.51 ms     | 8.42 ms: 1.01x faster  |
    | json_dumps                       | 5.43 ms     | 5.37 ms: 1.01x faster  |
    | tornado_http                     | 82.6 ms     | 81.8 ms: 1.01x faster  |
    | base85_large                     | 3.14 ms     | 3.10 ms: 1.01x faster  |
    | python_startup_no_site           | 6.13 ms     | 6.07 ms: 1.01x faster  |
    | connected_components             | 393 ms      | 389 ms: 1.01x faster   |
    | sympy_str                        | 149 ms      | 148 ms: 1.01x faster   |
    | sympy_integrate                  | 12.2 ms     | 12.1 ms: 1.01x faster  |
    | scimark_fft                      | 227 ms      | 226 ms: 1.01x faster   |
    | pathlib                          | 11.8 ms     | 11.7 ms: 1.01x faster  |
    | python_startup                   | 10.0 ms     | 9.97 ms: 1.01x faster  |
    | sqlglot_v2_normalize             | 68.1 ms     | 67.7 ms: 1.01x faster  |
    | chaos                            | 41.9 ms     | 41.7 ms: 1.01x faster  |
    | sqlglot_v2_optimize              | 33.6 ms     | 33.4 ms: 1.01x faster  |
    | spectral_norm                    | 74.7 ms     | 74.2 ms: 1.01x faster  |
    | sympy_sum                        | 80.4 ms     | 80.0 ms: 1.01x faster  |
    | scimark_monte_carlo              | 45.2 ms     | 45.0 ms: 1.01x faster  |
    | bpe_tokeniser                    | 3.05 sec    | 3.03 sec: 1.01x faster |
    | create_gc_cycles                 | 1.66 ms     | 1.66 ms: 1.00x faster  |
    | create_gc_cycles                 | 1.66 ms     | 1.66 ms: 1.00x faster  |
    | xml_etree_iterparse              | 74.8 ms     | 74.5 ms: 1.00x faster  |
    | sqlalchemy_declarative           | 74.0 ms     | 73.8 ms: 1.00x faster  |
    | gc_traversal                     | 3.31 ms     | 3.30 ms: 1.00x faster  |
    | crypto_pyaes                     | 50.3 ms     | 50.2 ms: 1.00x faster  |
    | sympy_expand                     | 258 ms      | 257 ms: 1.00x faster   |
    | shortest_path                    | 408 ms      | 407 ms: 1.00x faster   |
    | base64_large                     | 1.71 ms     | 1.71 ms: 1.00x faster  |
    | base32_large                     | 1.95 ms     | 1.95 ms: 1.00x faster  |
    | raytrace                         | 188 ms      | 189 ms: 1.00x slower   |
    | base32_small                     | 194 us      | 194 us: 1.00x slower   |
    | base16_small                     | 381 us      | 384 us: 1.01x slower   |
    | unpack_sequence                  | 27.1 ns     | 27.3 ns: 1.01x slower  |
    | async_tree_eager_cpu_io_mixed_tg | 324 ms      | 328 ms: 1.01x slower   |
    | meteor_contest                   | 65.9 ms     | 66.8 ms: 1.01x slower  |
    | unpickle                         | 8.25 us     | 8.37 us: 1.01x slower  |
    | typing_runtime_protocols         | 77.6 us     | 79.2 us: 1.02x slower  |
    | nqueens                          | 55.0 ms     | 56.2 ms: 1.02x slower  |
    | sqlglot_v2_parse                 | 734 us      | 754 us: 1.03x slower   |
    | regex_v8                         | 13.6 ms     | 14.2 ms: 1.05x slower  |
    | Geometric mean                   | (ref)       | 1.00x faster           |
    
    Benchmark hidden because not significant (74): logging_silent, bench_mp_pool, tomli_loads, xdsl_constant_fold, async_generators, regex_compile, async_tree_none, sphinx, async_tree_eager_io, dulwich_log, async_tree_eager_io_tg, async_tree_eager_memoization_tg, many_optionals, async_tree_cpu_io_mixed, async_tree_eager_memoization, pprint_pformat, asyncio_websockets, asyncio_tcp_ssl, k_core, deepcopy_memo, scimark_sor, base64_small, async_tree_cpu_io_mixed_tg, coverage, bench_thread_pool, async_tree_eager, django_template, base85_small, unpickle_list, ascii85_small, deepcopy, 2to3, mako, richards, hexiom, mdp, xml_etree_process, docutils, html5lib, generators, sqlite_synth, subparsers, pickle_dict, pickle_pure_python, regex_effbot, async_tree_eager_cpu_io_mixed, chameleon, async_tree_eager_tg, go, pprint_safe_repr, scimark_sparse_mat_mult, urlsafe_base64_small, comprehensions, deepcopy_reduce, deltablue, sqlglot_v2_transpile, json_loads, async_tree_io, logging_simple, xml_etree_generate, base16_large, async_tree_memoization, telco, fannkuch, regex_dna, async_tree_memoization_tg, asyncio_tcp, pyflate, async_tree_io_tg, scimark_lu, float, async_tree_none_tg, coroutines, nbody
    

    And here is the pyperformance result on my X86_64 (AMD EPYC 9124 16-Core) machine:

    Benchmarks with tag 'apps':
    ===========================
    
    | Benchmark      | pyperf-base | pyperf                |
    |----------------|:-----------:|:---------------------:|
    | chameleon      | 10.3 ms     | 10.5 ms: 1.02x slower |
    | tornado_http   | 88.8 ms     | 87.8 ms: 1.01x faster |
    | Geometric mean | (ref)       | 1.00x slower          |
    
    Benchmark hidden because not significant (4): 2to3, docutils, html5lib, sphinx
    
    Benchmarks with tag 'asyncio':
    ==============================
    
    | Benchmark          | pyperf-base | pyperf                |
    |--------------------|:-----------:|:---------------------:|
    | async_generators   | 312 ms      | 306 ms: 1.02x faster  |
    | async_tree_none    | 263 ms      | 258 ms: 1.02x faster  |
    | asyncio_websockets | 486 ms      | 487 ms: 1.00x slower  |
    | async_tree_eager   | 80.2 ms     | 80.7 ms: 1.01x slower |
    | Geometric mean     | (ref)       | 1.00x faster          |
    
    Benchmark hidden because not significant (17): async_tree_memoization_tg, async_tree_none_tg, async_tree_cpu_io_mixed, async_tree_eager_io, async_tree_io, async_tree_eager_cpu_io_mixed_tg, async_tree_memoization, async_tree_io_tg, asyncio_tcp_ssl, async_tree_eager_memoization_tg, async_tree_cpu_io_mixed_tg, async_tree_eager_io_tg, async_tree_eager_tg, asyncio_tcp, coroutines, async_tree_eager_cpu_io_mixed, async_tree_eager_memoization
    
    Benchmarks with tag 'math':
    ===========================
    
    | Benchmark      | pyperf-base | pyperf                |
    |----------------|:-----------:|:---------------------:|
    | pidigits       | 153 ms      | 148 ms: 1.04x faster  |
    | float          | 59.5 ms     | 58.0 ms: 1.03x faster |
    | nbody          | 85.0 ms     | 83.6 ms: 1.02x faster |
    | Geometric mean | (ref)       | 1.03x faster          |
    
    Benchmarks with tag 'regex':
    ============================
    
    | Benchmark      | pyperf-base | pyperf                |
    |----------------|:-----------:|:---------------------:|
    | regex_compile  | 94.0 ms     | 94.6 ms: 1.01x slower |
    | regex_dna      | 146 ms      | 147 ms: 1.01x slower  |
    | regex_v8       | 16.9 ms     | 17.4 ms: 1.03x slower |
    | Geometric mean | (ref)       | 1.01x slower          |
    
    Benchmark hidden because not significant (1): regex_effbot
    
    Benchmarks with tag 'serialize':
    ================================
    
    | Benchmark            | pyperf-base | pyperf                 |
    |----------------------|:-----------:|:----------------------:|
    | urlsafe_base64_small | 240 us      | 230 us: 1.05x faster   |
    | base16_small         | 431 us      | 415 us: 1.04x faster   |
    | base32_small         | 205 us      | 198 us: 1.04x faster   |
    | ascii85_small        | 463 us      | 448 us: 1.03x faster   |
    | ascii85_large        | 10.9 ms     | 10.6 ms: 1.03x faster  |
    | json_dumps           | 6.71 ms     | 6.54 ms: 1.03x faster  |
    | pickle               | 8.91 us     | 8.69 us: 1.03x faster  |
    | base85_small         | 178 us      | 174 us: 1.02x faster   |
    | tomli_loads          | 1.53 sec    | 1.51 sec: 1.02x faster |
    | xml_etree_generate   | 65.8 ms     | 65.0 ms: 1.01x faster  |
    | base64_large         | 1.86 ms     | 1.86 ms: 1.00x faster  |
    | xml_etree_iterparse  | 66.6 ms     | 67.1 ms: 1.01x slower  |
    | json_loads           | 16.6 us     | 16.7 us: 1.01x slower  |
    | pickle_list          | 3.85 us     | 3.89 us: 1.01x slower  |
    | xml_etree_parse      | 103 ms      | 104 ms: 1.01x slower   |
    | pickle_pure_python   | 228 us      | 231 us: 1.02x slower   |
    | unpickle             | 10.3 us     | 10.5 us: 1.02x slower  |
    | unpickle_pure_python | 162 us      | 165 us: 1.02x slower   |
    | Geometric mean       | (ref)       | 1.01x faster           |
    
    Benchmark hidden because not significant (7): xml_etree_process, base85_large, base32_large, base16_large, unpickle_list, pickle_dict, base64_small
    
    Benchmarks with tag 'startup':
    ==============================
    
    | Benchmark              | pyperf-base | pyperf                |
    |------------------------|:-----------:|:---------------------:|
    | python_startup         | 11.1 ms     | 11.1 ms: 1.01x faster |
    | python_startup_no_site | 6.84 ms     | 6.81 ms: 1.00x faster |
    | Geometric mean         | (ref)       | 1.01x faster          |
    
    Benchmarks with tag 'template':
    ===============================
    
    | Benchmark       | pyperf-base | pyperf                |
    |-----------------|:-----------:|:---------------------:|
    | django_template | 27.8 ms     | 28.3 ms: 1.02x slower |
    | Geometric mean  | (ref)       | 1.01x slower          |
    
    Benchmark hidden because not significant (1): mako
    
    All benchmarks:
    ===============
    
    | Benchmark              | pyperf-base | pyperf                 |
    |------------------------|:-----------:|:----------------------:|
    | urlsafe_base64_small   | 240 us      | 230 us: 1.05x faster   |
    | base16_small           | 431 us      | 415 us: 1.04x faster   |
    | base32_small           | 205 us      | 198 us: 1.04x faster   |
    | pidigits               | 153 ms      | 148 ms: 1.04x faster   |
    | unpack_sequence        | 35.4 ns     | 34.3 ns: 1.03x faster  |
    | ascii85_small          | 463 us      | 448 us: 1.03x faster   |
    | logging_silent         | 76.1 ns     | 73.9 ns: 1.03x faster  |
    | ascii85_large          | 10.9 ms     | 10.6 ms: 1.03x faster  |
    | deepcopy_memo          | 21.3 us     | 20.7 us: 1.03x faster  |
    | json_dumps             | 6.71 ms     | 6.54 ms: 1.03x faster  |
    | float                  | 59.5 ms     | 58.0 ms: 1.03x faster  |
    | pickle                 | 8.91 us     | 8.69 us: 1.03x faster  |
    | base85_small           | 178 us      | 174 us: 1.02x faster   |
    | async_generators       | 312 ms      | 306 ms: 1.02x faster   |
    | async_tree_none        | 263 ms      | 258 ms: 1.02x faster   |
    | tomli_loads            | 1.53 sec    | 1.51 sec: 1.02x faster |
    | nbody                  | 85.0 ms     | 83.6 ms: 1.02x faster  |
    | sqlglot_v2_parse       | 899 us      | 885 us: 1.02x faster   |
    | scimark_fft            | 253 ms      | 249 ms: 1.01x faster   |
    | xml_etree_generate     | 65.8 ms     | 65.0 ms: 1.01x faster  |
    | sqlglot_v2_transpile   | 1.12 ms     | 1.11 ms: 1.01x faster  |
    | deepcopy_reduce        | 2.10 us     | 2.08 us: 1.01x faster  |
    | tornado_http           | 88.8 ms     | 87.8 ms: 1.01x faster  |
    | scimark_monte_carlo    | 50.7 ms     | 50.3 ms: 1.01x faster  |
    | many_optionals         | 337 us      | 334 us: 1.01x faster   |
    | richards_super         | 37.3 ms     | 37.0 ms: 1.01x faster  |
    | python_startup         | 11.1 ms     | 11.1 ms: 1.01x faster  |
    | mdp                    | 901 ms      | 896 ms: 1.01x faster   |
    | connected_components   | 469 ms      | 467 ms: 1.01x faster   |
    | python_startup_no_site | 6.84 ms     | 6.81 ms: 1.00x faster  |
    | base64_large           | 1.86 ms     | 1.86 ms: 1.00x faster  |
    | asyncio_websockets     | 486 ms      | 487 ms: 1.00x slower   |
    | sqlite_synth           | 1.77 us     | 1.78 us: 1.01x slower  |
    | regex_compile          | 94.0 ms     | 94.6 ms: 1.01x slower  |
    | async_tree_eager       | 80.2 ms     | 80.7 ms: 1.01x slower  |
    | xml_etree_iterparse    | 66.6 ms     | 67.1 ms: 1.01x slower  |
    | sympy_sum              | 90.9 ms     | 91.6 ms: 1.01x slower  |
    | json_loads             | 16.6 us     | 16.7 us: 1.01x slower  |
    | pathlib                | 19.3 ms     | 19.4 ms: 1.01x slower  |
    | bench_mp_pool          | 7.77 ms     | 7.84 ms: 1.01x slower  |
    | pickle_list            | 3.85 us     | 3.89 us: 1.01x slower  |
    | sqlalchemy_imperative  | 8.28 ms     | 8.36 ms: 1.01x slower  |
    | regex_dna              | 146 ms      | 147 ms: 1.01x slower   |
    | xml_etree_parse        | 103 ms      | 104 ms: 1.01x slower   |
    | deepcopy               | 180 us      | 183 us: 1.01x slower   |
    | scimark_lu             | 85.8 ms     | 87.0 ms: 1.01x slower  |
    | sqlalchemy_declarative | 83.8 ms     | 85.1 ms: 1.01x slower  |
    | pickle_pure_python     | 228 us      | 231 us: 1.02x slower   |
    | unpickle               | 10.3 us     | 10.5 us: 1.02x slower  |
    | unpickle_pure_python   | 162 us      | 165 us: 1.02x slower   |
    | django_template        | 27.8 ms     | 28.3 ms: 1.02x slower  |
    | meteor_contest         | 75.4 ms     | 77.1 ms: 1.02x slower  |
    | pprint_pformat         | 1.09 sec    | 1.12 sec: 1.02x slower |
    | chameleon              | 10.3 ms     | 10.5 ms: 1.02x slower  |
    | pprint_safe_repr       | 545 ms      | 559 ms: 1.03x slower   |
    | scimark_sor            | 86.4 ms     | 88.9 ms: 1.03x slower  |
    | hexiom                 | 4.27 ms     | 4.41 ms: 1.03x slower  |
    | regex_v8               | 16.9 ms     | 17.4 ms: 1.03x slower  |
    | Geometric mean         | (ref)       | 1.00x faster           |
    
    Benchmark hidden because not significant (62): async_tree_memoization_tg, async_tree_none_tg, k_core, fannkuch, regex_effbot, async_tree_cpu_io_mixed, async_tree_eager_io, async_tree_io, scimark_sparse_mat_mult, richards, bench_thread_pool, crypto_pyaes, async_tree_eager_cpu_io_mixed_tg, generators, async_tree_memoization, sympy_expand, async_tree_io_tg, bpe_tokeniser, telco, asyncio_tcp_ssl, docutils, xml_etree_process, async_tree_eager_memoization_tg, async_tree_cpu_io_mixed_tg, pyflate, base85_large, base32_large, coverage, 2to3, logging_format, subparsers, comprehensions, async_tree_eager_io_tg, async_tree_eager_tg, sympy_integrate, sphinx, logging_simple, asyncio_tcp, base16_large, shortest_path, create_gc_cycles, html5lib, xdsl_constant_fold, sqlglot_v2_optimize, chaos, coroutines, dulwich_log, sympy_str, gc_traversal, sqlglot_v2_normalize, unpickle_list, async_tree_eager_cpu_io_mixed, deltablue, typing_runtime_protocols, mako, raytrace, spectral_norm, pickle_dict, base64_small, nqueens, async_tree_eager_memoization, go
    
    
  11. XiaohongGong commented on Sep 11, 2026

    @XiaohongGong
    Author

    I reviewed the benchmarks showing regressions greater than 3%. Based on the stddev values below, the observed regressions appear more likely to be caused by system noise than by the PR change itself. Please let me know if you would recommend any additional testing. Thanks a lot!

    AArch64 (NVIDIA Grace Neoverse-V2) machine:

    | sqlglot_v2_parse       | 734 us +- 7us      | 754 us +- 54us: 1.03x slower   |
    | regex_v8               | 13.6 ms  +- 0.2ms  | 14.2 ms +- 1.5ms: 1.05x slower |
    

    X86_64 (AMD EPYC 9124 16-Core) machine:

    | pprint_safe_repr       | 545 ms  +- 18ms    | 559 ms +- 18ms: 1.03x slower    |
    | scimark_sor            | 86.4 ms +- 2.0ms   | 88.9 ms +- 2.9ms: 1.03x slower  |
    | hexiom                 | 4.27 ms +- 0.13ms  | 4.41 ms +- 0.10ms: 1.03x slower |
    | regex_v8               | 16.9 ms +-  0.4ms  | 17.4 ms +- 0.3ms: 1.03x slower  |
    
  12. added a commit that references this issue on Oct 29, 2026
  13. changed the title [-]Keep PyLong loop carries as twodigits in shifts and division[/-] [+]Keep PyLong loop carries as twodigits in shifts[/+] on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions