* posix: add os.forkpty
pty.fork prefers forkpty so a nested spawn is a new session with its
own controlling tty. The openpty+login_tty fallback hung the
jsontests collector.
Assisted-by: Claude
* select: rebuild fd sets after EINTR
select(2) updates the sets in place. Retrying an interrupted call
with empty sets and a NULL timeout blocks forever.
Assisted-by: Claude
* http.server: keep CGI off the body-read timeout
A millisecond handler timeout races the client thread writing the
request and is inherited across CGI fork, which RSTs the client
under load.
Assisted-by: Claude
* Revert "http.server: keep CGI off the body-read timeout"
Lib edits outside a CPython copy are not allowed.
Assisted-by: Claude
* host_env: note why forkpty is libc not nix
Assisted-by: Claude
* benches: run deepcopy 10x more iterations
Assisted-by: Claude
* Unskip multiprocessing RLock repr test
Assisted-by: Grok:4.6
* Drop stable modules from the flaky MP CI list
Assisted-by: Grok:4.6
* Keep only multiprocessing fork on the flaky MP list
Assisted-by: Grok:4.6
* Drop gc_collect bench and unbreak two CI jobs
Remove benches/benchmarks/gc_collect.py so CodSpeed no longer
includes that execution benchmark.
On Windows, run test_multiprocessing_spawn serially; the
parallel snippets job hit a regrtest worker temp-dir error
while that suite was still running.
Install cargo-shear from a pinned prebuilt binary so the job
does not fall back to compiling 1.13.4 from source.
Assisted-by: Grok:4.6
* Unskip hang tests that now pass under -m test
Drop the RustPython hang skips on interpreter shutdown,
submit-after-shutdown, and connection pickling after they
passed with rustpython -m test.
Remove the unused expectedFailureIf around killpg on the
resource tracker deadlock test; os.killpg is present.
Pass matrix flaky-MP extras through the job environment
instead of interpolating them into the run script.
Assisted-by: Grok:4.6
* Restore hang skips and isolate spawn on CI
Put test_multiprocessing_spawn and
test_multiprocessing_forkserver back on the serial flaky MP
list. Ubuntu timed out in spawn test_notify_all under -j, and
forkserver.test_processes needed a rerun.
Restore the hang skips on interpreter shutdown, submit-after
shutdown, and connection pickling.
Assisted-by: Grok:4.6
* Run gc_collect ten times per benchmark iteration
Assisted-by: Grok:4.6
* Reuse the prebuilt rustpython for CI whats_left
whats_left was invoking cargo build --release without threading,
so the snippets job rebuilt the interpreter after the earlier
release build.
Assisted-by: Grok:4.6
* Split CI cargo run and test into build then execute
Assisted-by: Grok:4.6
* Compile doctests in the CI build step
cargo test --no-run skips doctests, so rustdoc compilation
was still happening in the run step.
Assisted-by: Grok:4.6
* Drop cron-ci.yaml from this PR
A pull_request path filter matches the whole PR, so every
push was starting the periodic benchmark and coverage jobs.
Assisted-by: Grok:4.6
* Run doctests in their own CI step
cargo test --doc --no-run is rejected, so doctests cannot
be compiled without also executing them.
Assisted-by: Grok:4.6
* Do not run benchmark targets in rust tests
--all-targets includes Criterion benches, which cargo test
does not run by default.
Assisted-by: Grok:4.6
Add dependency-free CPU-bound workloads adapted from pyperformance 1.14.0 to cover interpreter, standard-library serialization, regex, numeric, and garbage-collection paths under the existing Criterion and CodSpeed harnesses. Keep inputs deterministic and scale expensive cases for simulation while checking that benchmark execution does not leak interpreter state.
Assisted-by: Codex:gpt-5.6-sol
Alias criterion to codspeed-criterion-compat so the existing benchmark suites can be measured by CodSpeed with CPU simulation on every pull request, and add the workflow running them.
Co-authored-by: CodSpeed Bot <no-reply@codspeed.io>
Defer locals dict allocation for function frames until first access.
Most function frames only use fastlocals and never touch the locals
dict, so this skips one dict heap allocation per function call.
Also remove a redundant code.clone() in invoke_with_locals.
Func call ~23% faster, method call ~15% faster in benchmarks.
Change benchmark interpreter from without_stdlib to with_init to load
Rust-optimized native modules like _json, ensuring benchmarks measure
actual optimized performance rather than pure Python fallbacks.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add microbenchmark for `sorted`
I chose 5 * Iterations to try better show that RustPython
sort implementation scales noticeably worse CPython's
with respect to the number of elements.
* Mention how to run a specific benchmark
* Update python version in bench README
3.13 better reflects the current state of the project vs 3.7.
The original hash algorithm just XOR'd all the hashes of the elements of
the set, which is problematic. The CPython algorithm is required to pass
the tests.
- Replace `PyFrozenSet::hash` with CPython's algorithm
- Remove unused `hash_iter_unorded` functions
- Add `frozenset` benchmark
- Enable tests
- Lower performance expectations on effectiveness test
- Adjust `slot::hash_wrapper` so that it doesn't rehash the computed
hash value in the process of converting PyInt to PyHash.
Update the actual benchmark harnesses.
Because the internal APIs previously used are no longer available, I
opted to use `compile` and `exec` from within the CPython context to
compile and execute code. There's probably more overhead to that than
the internal API had, but that overhead should be consistent per
benchmark.
If anyone cares about hyperoptimizing benchmarks then they can optimize
the harness as well.
* list count bench
* Refactor list count avoid duplicate the vec
* optimize list count with HEAPTYPE flag
* introduce generic safe iter functions for list
* Refactor list functions (contains, index, remove)
* Refactor list iter functions with const generics
* optimize list with richcompare
* optimize list iter_equal