Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,31 @@ page.

### Added

- **`pyrer.parse_static_packages_py(paths) -> list[PackageData | None]`** —
batched, Rayon-parallel variant of `parse_static_package_py`
that opens and parses every path in one Rust call across a
thread pool. Output is positionally aligned with the input;
missing files, unreadable bytes, and parser-bails all map to
`None`. The GIL is released for the whole batch via
`Python::allow_threads`. Pool size follows
`RAYON_NUM_THREADS` (default: logical core count). Targets
issue #94's profile finding that serial Python `open()` was
the top of the resolve flamegraph (3.20 s of 9.12 s, 35% of
wall time) after the per-file static parser landed.
Closes #94.
- **`version_range` hint on the `load_family` callback** (issue #92) —
`pyrer.solve(..., load_family=cb)` now invokes `cb` as
`cb(name, version_range="2+<3")` when the callback's signature can
accept a second `version_range` argument (named param or `**kwargs`).
The hint is a rez-syntax range string the shim can pass directly to
`rez.packages.iter_packages(range_=...)` to skip on-disk version
directories outside the request. Backward-compatible: 1-arg
callbacks (`def cb(name):`) keep working unchanged — pyrer detects
the signature via `inspect.signature` once per `solve()` call.
Targets the 95% load-fan-out waste documented in #92 (2,637
packages loaded for 132 used on a typical Fortiche resolve);
projected 6-20× cut to `_load_family` wall time. The 188-case rez
differential still passes 188/188.
- **`PackageData.from_strings(name, version, requires=None, variants=None)`** —
classmethod constructor for raw-string callers, symmetric with
`from_rez(pkg)`. Skips rez's `AttributeForwardMeta` chain, the
Expand Down
10 changes: 7 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["crates/*"]
resolver = "2"

[workspace.package]
version = "0.1.0-rc.9"
version = "1.0.0-rc.3"
authors = [
"Lorenzo Montant <lo.montant.pro@gmail.com>",
"Maxim Doucet <maxim.doucet@gmail.com>",
Expand All @@ -23,8 +23,12 @@ lazy_static = "1.5.0"
rand = "0.8.5"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rer-version = { path = "crates/rer-version", version = "0.1.0-rc.9" }
rer-resolver = { path = "crates/rer-resolver", version = "0.1.0-rc.9" }
rer-version = { path = "crates/rer-version", version = "1.0.0-rc.3" }
rer-resolver = { path = "crates/rer-resolver", version = "1.0.0-rc.3" }
rer-package = { path = "crates/rer-package", version = "1.0.0-rc.3" }
# Rayon powers the batched `parse_static_packages_py` API (#94). Honours
# `RAYON_NUM_THREADS` for environments that need to cap the pool size.
rayon = "1"
pyo3 = { version = "0.23.5", features = ["extension-module"] }
# `mimalloc` is wired into the bench binary as a `#[global_allocator]`.
# Callgrind shows ~33 % of cycles in libc malloc/free; mimalloc has measurably
Expand Down
24 changes: 24 additions & 0 deletions crates/rer-package/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "rer-package"
version = { workspace = true }
description = "Fast static parser for the solver-relevant fields of a rez package.py."
edition = { workspace = true }
repository = { workspace = true }
readme = { workspace = true }
authors = { workspace = true }
license-file = { workspace = true }

[lib]
name = "rer_package"


[dependencies]
# Hand-rolled lexer — no AST library dependency. Stage 3 measurement
# showed `rustpython-parser` was ~2 ms/file because it built the
# whole module AST when we only needed four top-level fields.
#
# Rayon powers the batched `parse_static_packages_py` API (issue #94)
# that reads + parses many `package.py` files in parallel, replacing
# the rez shim's serial Python file-open loop (~3 s on a typical
# 132-package Fortiche resolve).
rayon = { workspace = true }
Loading
Loading