Skip to content

UPSTREAM PR #2978: Update Rust crate countio to 0.3.0 - #55

Open
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-2978-renovate-countio-0.x
Open

loci-dev wants to merge 1 commit into
mainfrom
loci/pr-2978-renovate-countio-0.x

Conversation

@loci-dev

Copy link
Copy Markdown

Note

Source pull request: nextest-rs/nextest#2978

This PR contains the following updates:

Package Type Update Change
countio workspace.dependencies minor 0.2.19 -> 0.3.0

Release Notes

spire-rs/countio (countio)

v0.3.0

Added
  • Progress<D> wrapper for tracking progress with percentage calculations
  • Separate expected_reader_bytes and expected_writer_bytes tracking in Progress
  • reader_percentage() and writer_percentage() methods for Progress
  • with_expected_reader_bytes(), with_expected_writer_bytes(), and with_expected_bytes() constructors
  • Clone implementation for Counter<D> and Progress<D> when D: Clone
  • Default implementation for Counter<D> and Progress<D> when D: Default
  • Debug implementation for Progress<D> when D: Debug
  • reset() method for both Counter and Progress to reset byte counters
  • std feature flag (enabled by default) for std::io trait implementations
Changed
  • Breaking: Renamed bytes_read() to reader_bytes() for consistency
  • Breaking: Renamed bytes_written() to writer_bytes() for consistency
  • Breaking: Renamed bytes_processed() to total_bytes()
  • Breaking: Changed with_bytes() parameter order to (inner, reader_bytes, writer_bytes)
  • Reworked CI pipeline
  • Bumped MSRV to 1.85 and updated to Rust 2024 edition
  • Updated README to accurately document available features
Removed
  • Breaking: Removed counter() and counter_mut() from Progress (use delegated methods instead)

Configuration

📅 Schedule: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles.

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@loci-review

loci-review Bot commented Feb 23, 2026

Copy link
Copy Markdown

Overview

This analysis evaluates the performance impact of updating the countio dependency from version 0.2.19 to 0.3.0 in Nextest, a next-generation Rust test runner. The change affects 1,226 modified functions out of 26,364 total functions (4.65%), with 1,875 new and 1,870 removed functions.

Power Consumption: The primary binary target.aarch64-unknown-linux-gnu.release.cargo-nextest shows a 0.051% increase (+350 nJ: 682,231 → 682,582 nJ). All other binaries show negligible or zero change: target.aarch64-unknown-linux-gnu.release.zstd-dict (-0.001%), target.aarch64-unknown-linux-gnu.release.build-seed-archive (-0.001%), and target.aarch64-unknown-linux-gnu.release.fake-interceptor, target.aarch64-unknown-linux-gnu.release.rustc-shim, target.aarch64-unknown-linux-gnu.release.grab-foreground, target.aarch64-unknown-linux-gnu.release.internal-test, target.aarch64-unknown-linux-gnu.release.large-alloc, and target.aarch64-unknown-linux-gnu.release.passthrough (all 0.000%).

Overall Assessment: Minimal performance impact with no changes to test execution hot paths. All affected functions are in configuration parsing and cleanup operations during startup.

Function Analysis

The analysis identified 15 functions with significant performance changes, all related to TOML configuration parsing and deserialization. No source code was modified—only the countio dependency was updated, making all performance changes compiler optimization artifacts.

Significant Improvements:

  • drop_in_place<IndexMap<Expression, Value>>: Response time improved 81.3% (3,479 ns → 650 ns, -2,830 ns) despite throughput time increasing 48.5% (+29 ns). Net improvement of 2,801 ns in configuration map cleanup.

  • drop_in_place<DeArray> (nextest_runner): Response time improved 84.4% (705 ns → 110 ns, -595 ns) with throughput time increasing 115.8% (+26 ns). Demonstrates aggressive inlining optimization with net gain of 569 ns.

  • drop_in_place<ConfigBuilder>: Response time improved 54.6% (10,357 ns → 4,706 ns, -5,651 ns) despite throughput time increasing 39.9% (+46 ns). Optimized destructor call chain.

  • add_source: Response time improved 53.7% (10,521 ns → 4,869 ns, -5,652 ns) with unchanged throughput time, indicating optimized child functions.

  • decode_literal_string: Response time improved 52.0% (525 ns → 252 ns, -273 ns). Response and throughput times converged, indicating eliminated call overhead through inlining.

  • next_value_seed: Response time improved 39.7% (11,849 ns → 7,147 ns, -4,701 ns) and throughput time improved 41.0% (5,035 ns → 2,972 ns, -2,063 ns). Uniform optimization across the serde deserialization pipeline.

Notable Regressions:

  • drop_in_place<DeArray> (cargo_nextest): Response time regressed 539.1% (110 ns → 705 ns, +595 ns) despite throughput time improving 53.7% (-26 ns). Same type as the improved variant above but compiled in different crate context, demonstrating context-sensitive compiler optimization.

  • drop_in_place<ValueDeserializer>: Response time regressed 165.4% (297 ns → 788 ns, +491 ns) with throughput time improving 19.1% (-35 ns). More efficient self-time offset by expensive nested destructor calls.

  • load_file: Response time regressed 75.4% (995 ns → 1,744 ns, +750 ns) and throughput time regressed 55.1% (+172 ns). Called 2-5 times during startup for cargo config discovery, resulting in ~1.7-3.8 μs total impact.

Context: All analyzed functions execute during startup configuration parsing, not in performance-critical paths (test execution, discovery, output processing). According to project insights, Nextest's critical hot paths include ExecutorContext::run_test_instance(), TestCommand::spawn(), and ChildAccumulator::fill_buf()—none of which were affected. The countio dependency is used exclusively in the recording subsystem for I/O byte counting, which operates in a separate thread.

Other analyzed functions showed mixed results with sub-microsecond changes in configuration cleanup and deserialization operations, all outside critical execution paths.

🔎 Full breakdown: Loci Inspector.
💬 Questions? Tag @loci-dev.

@loci-dev
loci-dev force-pushed the main branch 10 times, most recently from 8441290 to 23e6ba5 Compare March 2, 2026 05:47
@loci-dev
loci-dev force-pushed the main branch 5 times, most recently from 2957c7c to 3e47b9e Compare March 10, 2026 05:45
@loci-dev
loci-dev force-pushed the loci/pr-2978-renovate-countio-0.x branch from 77cd34d to 4f5644f Compare March 11, 2026 05:46
@loci-dev
loci-dev force-pushed the loci/pr-2978-renovate-countio-0.x branch from 4f5644f to d3f3404 Compare March 12, 2026 05:46
@loci-review

loci-review Bot commented Mar 12, 2026

Copy link
Copy Markdown

Overview

Analysis of 26,522 functions across 9 binaries following countio dependency update (0.2.19 → 0.3.0). 1,261 modified, 1,879 new, 1,889 removed functions identified.

Power Consumption Changes:

  • target.aarch64-unknown-linux-gnu.release.cargo-nextest: -0.088% (736,867.62 → 736,218.02 nJ)
  • target.aarch64-unknown-linux-gnu.release.zstd-dict: -0.009%
  • target.aarch64-unknown-linux-gnu.release.build-seed-archive: +0.009%
  • All other binaries (fake-interceptor, passthrough, rustc-shim, grab-foreground, internal-test, large-alloc): 0.0% change

Impact Assessment: Negligible — All performance changes isolated to TOML configuration parsing during startup initialization, not in test execution hot paths.

Function Analysis

Most Impacted Functions:

  1. drop_in_place (toml::de::parser::dearray::DeArray) — Multiple instances

    • Response: 110ns → 607ns (+449.7%)
    • Throughput: 49ns → 23ns (-53.7%)
    • Cause: Compiler refactored from manual loop cleanup to Vec::drop delegation (569ns overhead)
  2. drop_in_place (IndexMap<config::path::Expression, config::value::Value>)

    • Response: 650ns → 3,478ns (+434.8%)
    • Throughput: 90ns → 60ns (-32.7%)
    • Cause: New drop_slow path with reference counting overhead
  3. drop_in_place (toml::de::deserializer::value::ValueDeserializer)

    • Response: 206ns → 636ns (+208.9%)
    • Throughput: 89ns → 51ns (-42.2%)
    • Cause: New 4-level deallocation chain vs. 2-level in base
  4. drop_in_place (ConfigBuilder)

    • Response: 4,685ns → 10,354ns (+121.0%)
    • Throughput: 160ns → 115ns (-28.5%)
    • Cause: Target calls Vec::drop 3× instead of 2×
  5. ConfigBuilder::add_source

    • Response: 4,848ns → 10,516ns (+116.9%)
    • Throughput: 118ns → 116ns (-1.2%)
    • Cause: Tripled drop/cleanup operations in config crate
  6. write_str (nextest_runner::indenter::Indented)

    • Response: 2,547ns → 3,968ns (+55.8%)
    • Throughput: 226ns → 322ns (+42.2%)
    • Cause: 5 iterator calls vs. 2 in base; compiler optimization variance

Other analyzed functions showed improvements (IndexMap cleanup: -10.7% response time) or negligible changes in non-critical paths.

Source Code Context: No TOML-related code changes in repository. All regressions stem from compiler optimization differences between builds, not from the countio dependency update (used only for I/O byte counting in recording subsystem).

Performance-Critical Assessment: None of the affected functions are in Nextest's hot paths (test execution: ExecutorContext::run_test_instance(), TestCommand::spawn(); test discovery: TestList::new(); output processing: DisplayReporter::write_event_impl()). All changes affect one-time startup configuration parsing with cumulative overhead of ~10-15 microseconds.

Flame Graph Comparison

Selected function: cargo_nextest__ZN4core3ptr99drop_in_place$LT$indexmap..map..IndexMap$LT$config..path..Expression$C$config..value..Value$GT$$GT (largest absolute regression: +2,828ns)

Base version:

Flame Graph

Target version:

Flame Graph

The flame graphs show the target version introduces a deep call chain through drop (3,388ns) → drop (2,349ns) → drop_slow (884ns) with atomic synchronization overhead, replacing the base version's shallow nested drop_in_place calls. The drop_slow path indicates complex value destruction with reference counting, causing the 5.4× regression.

🔎 Full breakdown: Loci Inspector
💬 Questions? Tag @loci-dev

@loci-dev
loci-dev force-pushed the main branch 5 times, most recently from c41c002 to 4782f38 Compare March 17, 2026 05:04
@loci-dev
loci-dev force-pushed the main branch 10 times, most recently from 48e856b to 5e75774 Compare April 4, 2026 05:04
@loci-dev
loci-dev force-pushed the main branch 6 times, most recently from 3be9b2f to e1b0f98 Compare April 11, 2026 05:06
@loci-dev
loci-dev force-pushed the main branch 8 times, most recently from f85ce06 to 4cfdbc4 Compare April 18, 2026 05:13
@loci-dev
loci-dev force-pushed the main branch 3 times, most recently from feb6adf to fefd00d Compare April 21, 2026 05:17
@loci-review

loci-review Bot commented Apr 26, 2026

Copy link
Copy Markdown

Overview

Analysis of 26,857 functions across 9 binaries following countio dependency update (0.2.19 → 0.3.0). 1,290 modified (4.8%), 1,941 new, 1,942 removed, 21,684 unchanged.

Power consumption: Effectively unchanged across all binaries:

  • target.aarch64-unknown-linux-gnu.release.cargo-nextest: -0.02%
  • target.aarch64-unknown-linux-gnu.release.zstd-dict: +0.01%
  • All other binaries (build-seed-archive, passthrough, rustc-shim, fake-interceptor, grab-foreground, internal-test, large-alloc): 0.00%

Impact: Negligible. All performance changes occur in configuration initialization and TOML parsing cleanup (startup only), not in test execution hot paths. Total startup overhead: ~13 microseconds.

Function Analysis

Configuration Initialization (startup only):

  • ConfigBuilder::drop_in_place (nextest_runner): Response time +138% (+6,038ns), throughput time -35% (-52ns). Compiler optimization trade-off: simplified CFG (27 vs 47 blocks) but drop operations execute 3× instead of once.

  • ConfigBuilder::add_source: Response time +121% (+5,733ns), throughput time -2% (-2ns). Regression in exception handling paths (drop operations), not add_source logic. CFG structure unchanged.

  • IndexMap::drop_in_place (nextest_runner): Response time +125% (+404ns), throughput time -40% (-36ns). Refactored from inline iteration to Vec drop delegation. Stack frame reduced 35%.

TOML Deserialization Cleanup (startup only):

  • Result<Option<Content>, Error>::drop_in_place: Response time +726% (+1,051ns), throughput time 0%. New drop_slow path (966ns) with explicit deallocation and atomic operations.

  • DeArray::drop_in_place (cargo_nextest): Response time +518% (+570ns), throughput time -54% (-26ns). Delegates to Vec::drop (643ns) instead of iterative cleanup (47ns).

  • DeArray::drop_in_place (nextest_runner): Response time -84% (-570ns), throughput time +116% (+26ns). Improvement: Replaced Vec::drop (643ns) with drop_in_place (47ns).

Reporter Initialization (once per run):

  • EventAggregator::new: Response time -41% (-866ns), throughput time +43% (+45ns). Improvement: Rust stdlib optimization using TLS-cached random keys, eliminating expensive call_once→get_or_init_slow→drop_slow chain (1,369ns).

Compiler Optimizations:

  • OUTLINED_FUNCTION_4: Response time -99% (-231ns). Improvement: Eliminated futex synchronization (228ns), optimized to register operations (3ns).

  • OUTLINED_FUNCTION_3: Response time +91% (+111ns). Semantic change from panic path to futex synchronization, reflecting countio 0.3.0's shift to lazy initialization.

Other analyzed functions (TOML destructors, error formatting, ZSTD initialization) showed similar patterns with negligible real-world impact.

Source Code Context: No direct nextest source changes. All performance differences stem from compiler optimization variations in external dependencies (config crate, toml crate, ZSTD library) between builds. The countio update affects only the recording subsystem, which runs in a separate thread isolated from test execution.

Critical Path Assessment: Zero impact. None of the modified functions are in performance-critical paths (ExecutorContext::run_test_instance, TestCommand::spawn, ChildAccumulator::fill_buf, DispatcherContext::run).

Flame Graph Comparison

Selected function: ConfigBuilder::drop_in_place (largest absolute regression, +6,038ns, shows structural call chain changes)

Base version:
Flame Graph: target.aarch64-unknown-linux-gnu.release.cargo-nextest::nextest_runner__ZN4core3ptr88drop_in_place$LT$config..builder..ConfigBuilder$LT$config..builder..DefaultState$GT$$GT

Target version:
Flame Graph: target.aarch64-unknown-linux-gnu.release.cargo-nextest::nextest_runner__ZN4core3ptr88drop_in_place$LT$config..builder..ConfigBuilder$LT$config..builder..DefaultState$GT$$GT

Target version shows three separate drop operations (each ~2,290ns) and three drop_slow calls (each ~966ns) that execute repeatedly, compared to single execution in base version. Despite this, the function's own code is 35% faster (throughput improved 150ns→98ns), indicating a compiler optimization trade-off: simpler local code but more expensive delegated cleanup.

💬 Questions? Tag @loci-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants