Repository navigation
Conversation
moreal
force-pushed
the
perf/str-inplace-concat
branch
from
September 2, 2026 17:21
9e11753 to
1c58b2a
Compare
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/profiling dependencies:
dependent tests: (3 tests)
[x] test: cpython/Lib/test/test_external_inspection.py dependencies: dependent tests: (no tests depend on external_inspection) [ ] test: cpython/Lib/test/test_set.py (TODO: 1) dependencies: dependent tests: (no tests depend on set) [x] lib: cpython/Lib/traceback.py dependencies:
dependent tests: (170 tests)
Legend:
|
youknowone
force-pushed
the
perf/str-inplace-concat
branch
from
September 16, 2026 17:16
1c58b2a to
91df720
Compare
…ython#9340) * Align offline profiler argument binding with Python 3.15 Accept the canonical keyword names for binary sample writes and native context exits. Resolve the argument layout before numeric callbacks, then preserve float-subclass payloads while accepting numeric protocols for required and optional profile statistics. AI-assisted source extraction, implementation, and source review with OpenAI Codex. Runtime validation remains pending. Assisted-by: OpenAI Codex:model version unavailable * Restore the offline profiler capability flag Preserve the original mega branch's zero-valued process_vm_readv capability export. The native live unwinder remains unsupported; this restores the public feature query without claiming live inspection support or changing canonical test helpers. AI-assisted source preservation and review with OpenAI Codex. Assisted-by: OpenAI Codex:model version unavailable * Restore finite-EOF table bounds for offline profiles Match CPython's EOF-wide table count and decoding windows while retaining checked offsets, allocation limits, cursor bounds, and replay checks. This restores the original mega's finite-file contract without changing canonical tests or the already validated argument-binding implementation. Assisted-by: OpenAI Codex:model version unavailable * Preserve symtable warning exceptions and original filenames (RustPython#9282) Keep warning-hook exceptions untouched instead of rewriting SyntaxError subclasses. Thread the original Python filename through parser warning emission and fresh warning-as-error SyntaxError construction, preserving fsdecoded bytes paths and lone surrogates. Assisted-by: OpenAI Codex:model-version-unavailable * build(deps): align the Cranelift 0.136 dependency family (RustPython#9341) * build(deps): bump the wasmtime group across 1 directory with 2 updates Bumps the wasmtime group with 2 updates in the / directory: [cranelift](https://github.com/bytecodealliance/wasmtime) and [cranelift-module](https://github.com/bytecodealliance/wasmtime). Updates `cranelift` from 0.135.2 to 0.136.3 - [Release notes](https://github.com/bytecodealliance/wasmtime/releases) - [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md) - [Commits](https://github.com/bytecodealliance/wasmtime/commits) Updates `cranelift-module` from 0.135.3 to 0.136.3 - [Release notes](https://github.com/bytecodealliance/wasmtime/releases) - [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/RELEASES.md) - [Commits](https://github.com/bytecodealliance/wasmtime/commits) --- updated-dependencies: - dependency-name: cranelift dependency-version: 0.136.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: wasmtime - dependency-name: cranelift-module dependency-version: 0.136.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: wasmtime ... Signed-off-by: dependabot[bot] <[email protected]> * Align cranelift-jit with the 0.136 dependency family Update cranelift-jit alongside cranelift and cranelift-module so the JIT shares their LibCall, FuncId, and Module trait identities. Regenerate only the affected dependency lock entries, preserving the original dependency PR changes. AI assistance covered the dependency diagnosis, alignment, and static review. Assisted-by: OpenAI Codex:model-version-unavailable --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Support selective canonical function migration Add hash-pinned function selection to the official Lib migration tool, preserving canonical source bytes and rejecting ambiguous dependencies. Assisted-by: OpenAI Codex:model version unavailable * Detect CPython runtimes for canonical inspection feature checks Add native runtime-cookie detection and import the exact Python 3.15 inspection helpers and tests through the official Lib migration tool. Preserve the offline profiler argument and finite-EOF corrections. Assisted-by: OpenAI Codex:model version unavailable --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…#9343) Assisted-by: Codex:GPT-6
Extract independent bytecode tooling from the Python 3.15 integration. Decode packed import-name arguments without changing older-interpreter fallback behavior, validate canonical opcode numbering, bound deoptimization families to the enum, and reuse parsed CPython analysis. Validated generators reproduce tracked metadata exactly; normal, lazy and eager import fallback matches canonical disassembly. No interpreter, generated metadata or test changes. Assisted-by: OpenAI Codex: model version unavailable
Import the unchanged Python 3.15.0 fixture with the official library updater and retire the missing-fixture expectedFailure after validating the existing distance and threshold tests. Preserve all assertions and unrelated markers. Assisted-by: OpenAI Codex: model version unavailable
Use decoded logical instructions rather than the preceding raw operand byte. Check referenced constants by None identity and decode common constants without panicking. Assisted-by: OpenAI Codex:model unavailable
…ustPython#9348) Bumps [reviewdog/action-actionlint](https://github.com/reviewdog/action-actionlint) from 1.80.2 to 1.80.4. - [Release notes](https://github.com/reviewdog/action-actionlint/releases) - [Commits](reviewdog/action-actionlint@3cbf14e...419a493) --- updated-dependencies: - dependency-name: reviewdog/action-actionlint dependency-version: 1.80.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [mach2](https://github.com/JohnTitor/mach2) from 0.4.3 to 0.7.0. - [Release notes](https://github.com/JohnTitor/mach2/releases) - [Commits](JohnTitor/mach2@0.4.3...0.7.0) --- updated-dependencies: - dependency-name: mach2 dependency-version: 0.7.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.9.11 to 0.9.12. - [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md) - [Commits](RazrFalcon/memmap2-rs@v0.9.11...v0.9.12) --- updated-dependencies: - dependency-name: memmap2 dependency-version: 0.9.12 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
RustPython#9352) Bumps [@xterm/addon-fit](https://github.com/xtermjs/xterm.js) from 0.10.0 to 0.11.0. - [Release notes](https://github.com/xtermjs/xterm.js/releases) - [Commits](xtermjs/xterm.js@0.10...0.11) --- updated-dependencies: - dependency-name: "@xterm/addon-fit" dependency-version: 0.11.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [object](https://github.com/gimli-rs/object) from 0.37.3 to 0.40.0. - [Changelog](https://github.com/gimli-rs/object/blob/main/CHANGELOG.md) - [Commits](gimli-rs/object@0.37.3...v0.40.0) --- updated-dependencies: - dependency-name: object dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ustPython#9354) Bumps [xterm-readline](https://github.com/strtok/xterm-readline) from 1.1.2 to 1.3.1. - [Changelog](https://github.com/strtok/xterm-readline/blob/main/CHANGELOG.md) - [Commits](https://github.com/strtok/xterm-readline/commits/v1.3.1) --- updated-dependencies: - dependency-name: xterm-readline dependency-version: 1.3.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…on#9353) Bumps [mini-css-extract-plugin](https://github.com/webpack/mini-css-extract-plugin) from 2.9.2 to 2.10.2. - [Release notes](https://github.com/webpack/mini-css-extract-plugin/releases) - [Changelog](https://github.com/webpack/mini-css-extract-plugin/blob/main/CHANGELOG.md) - [Commits](webpack/mini-css-extract-plugin@v2.9.2...v2.10.2) --- updated-dependencies: - dependency-name: mini-css-extract-plugin dependency-version: 2.10.2 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ustPython#9355) Bumps [css-loader](https://github.com/webpack/css-loader) from 7.1.2 to 7.1.5. - [Release notes](https://github.com/webpack/css-loader/releases) - [Changelog](https://github.com/webpack/css-loader/blob/main/CHANGELOG.md) - [Commits](webpack/css-loader@v7.1.2...v7.1.5) --- updated-dependencies: - dependency-name: css-loader dependency-version: 7.1.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Import the CLI, entry point, error type, coordinator dependency, and CLI tests with scripts/update_lib migrate from CPython 3.15.0 at d220409a13b77de7a6c30abe16ea90db01528edc. This frontend follows the existing offline collector/codec support. Live attach, run, and dump remain unsupported and unvalidated. Assisted-by: OpenAI Codex: model version unavailable
Stop automatically labeling OSCCA participants' pull requests with z-ca-2026 and assigning them, and drop the matching zizmor ignore entry. Assisted-by: Claude Code:claude-opus-5-5
Assisted-by: Codex:gpt-5.6-sol
Assisted-by: Codex:gpt-5.6-sol
moreal
force-pushed
the
perf/str-inplace-concat
branch
from
October 25, 2026 11:01
91df720 to
4342bfc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One of the checkboxes below must be checked before this draft is submitted upstream.
Summary
Repeated in-place string concatenation previously allocated an exactly sized buffer and copied the entire left-hand string for every append. A loop using
s += piecetherefore scaled quadratically.Store owned string data in a capacity-bearing
Wtf8Bufand reuse that allocation when the left operand is uniquely owned. String kind and character length are packed into one atomic metadata word so the payload remains five machine words. Shared left operands retain copy-on-write behavior, and cached hash/index state is invalidated when a unique string is extended.This is an internal performance change. Python-visible string immutability and concatenation behavior are unchanged.
Performance
benches/microbenchmarks/str_inplace_concat.pyrepeatedly appends a short string to an initially empty string. Comparing the benchmark-only baseline with this change:The widening improvement as the input grows is consistent with replacing repeated full-prefix copies with amortized buffer growth.
Testing
cargo run --release -- -m test test_str(138 passed, 10 skipped)cargo fmt --all -- --checkcargo clippy -p rustpython-vm --all-targets -- -D warningscargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi(cd crates/capi && cargo test)(103 passed)AI assistance
Codex (
gpt-5.6-sol) assisted extensively with the implementation, tests, benchmark setup and analysis, automated validation, code review, and drafting this PR description. Before submission upstream, the contributor must personally review the final diff and complete the hands-on verification required by the project AI policy.