Skip to content

gh-162350: Add AC vectorcall for queue.SimpleQueue - #162505

Merged
asvetlov merged 1 commit into
python:mainfrom
tanloong:simplequeue_vectorcall
Nov 25, 2026
Merged

asvetlov merged 1 commit into
python:mainfrom
tanloong:simplequeue_vectorcall

Conversation

@tanloong

@tanloong tanloong commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Add @vectorcall to _queue.SimpleQueue.__new__. There is no change of exception text for bad arguments.

Benchmark:

+---------------+--------+----------------------+
| Benchmark     | main   | patch                |
+===============+========+======================+
| SimpleQueue() | 150 ns | 117 ns: 1.29x faster |
+---------------+--------+----------------------+
Details
import pyperf

SETUP = """
from queue import SimpleQueue
"""

CASES = [
    ('SimpleQueue()', 'SimpleQueue()')
]

runner = pyperf.Runner()
for name, stmt in CASES:
    runner.timeit(name, stmt=stmt, setup=SETUP)
@asvetlov
asvetlov merged commit 85e3098 into python:main Nov 25, 2026
62 checks passed
@bedevere-bot

Copy link
Copy Markdown

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot AMD64 FreeBSD14 3.x (tier-3) has failed when building commit 85e3098.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1232/builds/9999) and take a look at the build logs.
  4. Check if the failure is related to this commit (85e3098) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1232/builds/9999

Failed tests:

  • <regrtest
  • test_free_threading.test_dict_watcher
  • worker>
  • test_imaplib

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 212, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1388, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1352, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1241, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'test.<regrtest worker>'


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 350, in run_single_test
    _runtest(result, runtests)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 321, in _runtest
    _runtest_env_changed_exc(result, runtests,
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                             display_failure=not verbose)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 223, in _runtest_env_changed_exc
    print(
    ~~~~~^
        f"{stdout.YELLOW}{test_name} skipped -- {exc}{stdout.RESET}",
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        flush=True,
        ^^^^^^^^^^^
    )
    ^
OSError: [Errno 28] No space left on device


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 212, in _runtest_env_changed_exc
    _load_run_test(result, runtests)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/single.py", line 155, in _load_run_test
    test_mod = importlib.import_module(module_name)
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1388, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1337, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1298, in _resolve_parents
  File "<frozen importlib._bootstrap>", line 490, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1388, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1352, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1248, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 856, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 754, in exec_module
  File "<frozen importlib._bootstrap>", line 490, in _call_with_frames_removed
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/test_free_threading/__init__.py", line 8, in <module>
    raise unittest.SkipTest("GIL enabled")
unittest.case.SkipTest: GIL enabled


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/runpy.py", line 201, in _run_module_as_main
    return _run_code(code, main_globals, None,
                     "__main__", mod_spec)
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/runpy.py", line 87, in _run_code
    exec(code, run_globals)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/worker.py", line 141, in <module>
    main()
    ~~~~^^
Warning -- Unraisable exception
Exception ignored in the internal traceback machinery:
bject type name: OSError
bject repr     : OSError(28, 'No space left on device')
lost sys.stderr
Warning -- regrtest worker thread failed: Traceback (most recent call last):
Warning --   File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/run_workers.py", line 424, in run
Warning --     mp_result = self._runtest(
Warning --         test_name,
Warning --         module_name if single_process_per_case else None)
Warning --   File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/run_workers.py", line 377, in _runtest
Warning --     retcode, tmp_files = self.run_tmp_files(worker_runtests,
Warning --                          ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
Warning --                                             stdout_file.fileno())
Warning --                                             ^^^^^^^^^^^^^^^^^^^^^
Warning --   File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/run_workers.py", line 308, in run_tmp_files
Warning --     tmp_dir = tempfile.mkdtemp(prefix="test_python_")
Warning --   File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/tempfile.py", line 440, in mkdtemp
Warning --     _os.mkdir(file, 0o700)
Warning --     ~~~~~~~~~^^^^^^^^^^^^^
Warning -- OSError: [Errno 28] No space left on device: '/tmp/test_python_wnh2v9le'
Kill <WorkerThread #1 running test=test.test_multiprocessing_spawn.test_manager pid=29329 time=25.9 sec> process group
Kill <WorkerThread #2 running test=test_operator pid=29532 time=1.1 sec> process group
Kill <WorkerThread #3 running test=test_regrtest pid=28905 time=1 min 30 sec> process group
Kill <WorkerThread #4 running test=test_math pid=28911 time=1 min 29 sec> process group
Kill <WorkerThread #6 running test=test.test_gdb.test_cfunction_full pid=29528 time=2.0 sec> process group
Kill <WorkerThread #7 running test=test_venv pid=29400 time=15.6 sec> process group
Kill <WorkerThread #8 running test=test_code pid=29530 time=1.7 sec> process group


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/worker.py", line 118, in worker_process
    result.write_json_into(json_fp)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/buildbot/buildarea/3.x.opsec-fbsd14/build/Lib/test/libregrtest/result.py", line 229, in write_json_into
    file.flush()
    ~~~~~~~~~~^^
OSError: [Errno 28] No space left on device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants