Commit Graph
73 Commits
Author SHA1 Message Date
1ndahous3 3af5f8a153 Run benchmark workloads with consistent script namespaces (#9027)
Assisted-by: Codex:gpt-6
2026-10-10 09:25:57 +09:00
Joshua Megnauth 86c7fa20c4 Fix missing workspace lints & fix lints (#8781)
Some of the workspace packages were missing the `[lints]` table. I
enabled the lints then fixed the resulting errors.
2026-09-24 07:49:50 +09:00
Jeong, YunWon eb1546ae08 posix: add os.forkpty so pty.spawn does not hang (#8782)
* 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
2026-09-22 14:54:46 +09:00
Jeong, YunWon 4cc7559aeb Drop gc_traversal from CodSpeed benches (#8750)
Remove benches/benchmarks/gc_traversal.py so CodSpeed no longer
includes that execution benchmark.

Assisted-by: Grok:4.6
2026-09-20 14:56:46 +09:00
Jeong, YunWon 0c5a47bae5 Unskip MP tests and shrink the flaky MP CI list (#8731)
* 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
2026-09-19 10:38:05 +09:00
Jeong, YunWon d7e41ebff5 Split CI cargo run and test into build then execute (#8705)
* 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
2026-09-14 22:08:40 +09:00
Lee Dogeon 99a63f92aa benchmarks: add pyperformance workloads (#8633)
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
2026-09-01 10:03:29 +09:00
codspeed-hq[bot]andCodSpeed Bot 062bd72c60 Add CodSpeed continuous benchmarking (#8613)
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>
2026-08-30 15:18:33 +09:00
Shahar Naveh 7da696661b Reduce number of string clones when compiling python source code (#8103) 2026-06-15 11:20:48 +09:00
Jeong, YunWon 1863b9c788 Lazy locals dict for NEWLOCALS frames (#7307)
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.
2026-03-03 09:17:17 +09:00
Jeong YunWon 20376451eb Implement Py_mod_create slot support in multi-phase init 2026-01-22 11:21:42 +09:00
Jeong YunWon bc02b2318c module_exec 2026-01-21 22:39:40 +09:00
Lee DogeonandClaude Opus 4.5 4ab6a45405 Use stdlib native modules in benchmarks (#6792)
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>
2026-01-19 08:43:25 +09:00
Lee Dogeon 2e5257d098 Introduce benchmark for json.loads (#6723) 2026-01-14 14:44:34 +09:00
Jeong, YunWon c71c78c1a0 Upgrade pyo3 (#6389) 2025-12-10 10:29:20 +09:00
Shahar Naveh 141ed72693 Dependencies cleanup (#6151)
* Update deps

* Remove some unused deps

* Update lockfile
2025-09-17 09:10:35 +09:00
Jack O'Connor 763d5d48b5 Add sorted.py to microbenchmarks (#6086)
* 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.
2025-08-28 09:58:20 +09:00
Jeong, YunWon fe2c9bf361 Fix stable clippy (#5843) 2025-06-27 12:12:21 +09:00
Ashwin Naren a7ad848270 Rust dependency updates (#5651) 2025-04-15 08:50:29 +09:00
Ashwin Naren b81ae9b954 More cspell fixes (#5670) 2025-04-11 09:37:20 +09:00
Noa 6b72d2ef5d Check+lint examples, tests, and benches in CI 2025-03-28 11:26:12 +09:00
Ashwin Naren b870b0e1b5 2024 edition formatting
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
2025-02-26 11:48:22 -08:00
Noa 37dc28a69d Update deps (#5417)
* Upgrade nix

* Update deps

* Upgrade pyo3, winreg

* Fix errors from upgrading
2024-09-27 13:11:00 +09:00
Jeong YunWon 24f57dde2f Align Settings to PyConfig 2024-04-30 23:18:14 +09:00
wellweek 2fde8e91e5 fix some typos (#5187)
Signed-off-by: wellweek <xiezitai@outlook.com>
2024-03-11 15:01:37 +09:00
Jeong, YunWon 1c93c1630b Merge pull request #5164 from dchiquito/frozenset-hash
Use CPython hash algorithm for frozenset
2024-02-10 14:55:24 +09:00
Daniel Chiquito bf461cdebc Use CPython hash algorithm for frozenset
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.
2024-02-09 21:02:40 -05:00
Daniel Chiquito ea1f72e92d Replace rust-cpython with pyo3 in benches
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.
2024-02-09 16:12:47 -05:00
Jeong YunWon 1208416b92 0.3.0 release 2023-09-06 18:49:55 +09:00
Jim Fasarakis-Hilliard 06c6244599 Fix failures in the cron ci. (#5002) 2023-06-11 14:23:17 +03:00
Jeong YunWon f078f79c90 Flatten rustpython_parser interface 2023-02-22 20:32:31 +09:00
Jeong YunWon d94f638784 Fix nightly clippy warnings 2022-10-16 02:38:50 +09:00
Jeong YunWon d45f3da192 Add source_path to ParseError 2022-08-22 08:42:20 +09:00
Noa 33e848e32e Fix benches 2022-08-18 20:52:11 -05:00
Jeong Yunwon c99b05b466 increase nbody benches argument 2022-06-04 18:02:36 +09:00
Jeong Yunwon 386057cdf5 Add fannkuch.py 2022-05-29 08:19:47 +09:00
Jeong Yunwon 9b2a9d2377 TypeZoo uses &'static Py<PyType> 2022-05-27 10:35:01 +09:00
Jeong Yunwon fb52694e41 PyAttributes key is PyStrInterned 2022-05-23 09:03:13 +09:00
Jeong Yunwon 40bc8f0016 move microbenchmark strings.py to proper directory 2022-05-12 04:21:40 +09:00
Jeong Yunwon 3b9721c326 Add microbenchmarks/cmp.py 2022-05-12 04:21:40 +09:00
Jeong Yunwon 6fd5094c05 Remove Interpreter::default() not to trap users init without stdlib 2022-04-30 05:09:33 +09:00
Jeong Yunwon ab7d921772 PySettings is not a python object 2022-04-23 07:56:20 +09:00
Jeong Yunwon c4b80b3a24 IntoObject::into_object() and PyValue::into_pyobject(vm) 2022-04-19 00:38:18 +09:00
Jeong Yunwon 6357a1acbe clean up imports and useless allow attributes 2022-04-15 23:58:20 +09:00
Kangzhi Shi 9a2eef6fab fix compile 2021-11-27 13:49:05 +02:00
stvsmth ba6f855a66 Fix typo in benches readme.
Correct the file location of the index.html file.
2021-11-02 08:37:37 -06:00
Padraic Fanning a50b91bb0e Make benchmark work with act, and fix import
This doesn't remedy a certain benchmark's possible memory consumption.
2021-10-24 01:47:12 -04:00
jfh 6ce591d90c Use as_object in benchmark locals. 2021-10-19 16:50:27 +03:00
Steve Shi 723357962a Refactor list avoid duplicate the vec (#3241)
* 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
2021-10-16 13:16:45 +09:00
Jeong YunWon a42d547a3f new_{utf8_str, ascii_literal} -> new_str again 2021-10-11 21:28:14 +09:00