Skip to content

Update dependencies, require polars 2, and speed up the binary - #2

Merged
KonScanner merged 2 commits into
mainfrom
chore/deps-polars2-and-release-perf
Oct 6, 2026
Merged

KonScanner merged 2 commits into
mainfrom
chore/deps-polars2-and-release-perf

Conversation

@KonScanner

Copy link
Copy Markdown
Owner

Overview of changes

  • Fix RUSTSEC-2026-0285 (rustls 0.23.40 → 0.23.45). Fix RUSTSEC-2026-0253 (lru 0.16 → 0.18 through alloy 2.0.5 → 2.5.0). Remove the two deny.toml ignore entries that are no longer necessary.
  • Require Python polars>=2 in pyproject.toml and in CI. Before, the package did not declare polars at all.
  • Add python_tests/test_offline_rpc.py. A local JSON-RPC server replays two recorded mainnet blocks, so CI tests the Rust → Python DataFrame hand-off without an endpoint secret.
  • Update governor 0.6 → 0.10, rand 0.8 → 0.10, syn 1 → 2, mesc 0.1 → 0.3, colored 2 → 3, tokio, indicatif and pyo3 patch versions.
  • Update actions/checkout and setup-python to v7, upload-artifact to v7, and download-artifact to v8. Replace the retired macos-13 runner with macos-15-intel.
  • Add [profile.release] with lto = "thin" and codegen-units = 1 in both workspaces.
  • Use jemalloc as the allocator of the triodion binary, behind the default jemalloc feature. The Python wheel and Windows MSVC builds keep the system allocator. CI now also runs clippy with --no-default-features.
  • Report an empty #[to_df()] attribute as a compile error, not a panic.

Reasoning

The Rust polars crate for 2.0 is not published yet, so the Rust side stays on polars 0.55 with pyo3-polars 0.28. The hand-off to Python polars 2.0.0 works, and the new offline test keeps that true. Every speed setting was measured before it was added. Fat LTO and mimalloc were measured and rejected.

Tests

  • Root workspace: cargo build, cargo test (257 passed), clippy -D warnings with --all-features and with --no-default-features, cargo +nightly fmt --check, and cargo deny check.
  • crates/python with toolchain 1.95.0: clippy -D warnings, build, fmt, and cargo deny. The wheel installs polars 2.0.0 by itself, and pytest gives 9 passed and 28 skipped (endpoint tests).
  • The triodion-core macro expansion is byte-identical with syn 1 and syn 2.
  • I ran the CLI against the replay server with --chunk-order random --requests-per-second 2. Both chunks were written, and the rate limit held.
  • Benchmark: 50 replayed mainnet blocks (15,520 transactions), hyperfine, 40 runs. Wall time 324 → 268 ms, user CPU −21 %, peak memory 167 → 208 MB, binary 73 → 49 MB. The output parquet is identical.
  • actionlint passes on both workflows.

TL;DR

Fix two advisories, move to Python polars 2 and current dependency majors, and make the CLI binary about 1.2 times faster.

Fix the rustls and lru advisories, require Python polars 2, and move
governor, rand, syn, mesc, colored and the CI actions to current majors.
Build releases with thin LTO and use jemalloc in the binary, which
decreased user CPU time by 21 percent in a replayed mainnet benchmark.
@KonScanner KonScanner self-assigned this Oct 6, 2026
@KonScanner KonScanner added the enhancement New feature or request label Oct 6, 2026
Clippy 1.99 adds this code to the single_element_loop lint, and CI
installs the latest stable toolchain, so the clippy job failed.
@KonScanner
KonScanner merged commit b2832a7 into main Oct 6, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant