Skip to content

UPSTREAM PR #2443: gix-error conversion batch 1 (part 2)#24

Open
loci-dev wants to merge 1 commit intomainfrom
loci/pr-2443-gix-error
Open

UPSTREAM PR #2443: gix-error conversion batch 1 (part 2)#24
loci-dev wants to merge 1 commit intomainfrom
loci/pr-2443-gix-error

Conversation

@loci-dev
Copy link
Copy Markdown

Note

Source pull request: GitoxideLabs/gitoxide#2443

Follow-up of #2423.

Tasks

  • thorough review for crate gix-fs

Crates done

  • TBD
  Batch 1 Migration Complete

  11 crates migrated from thiserror to gix-error, in 11 commits:
  ┌────────────────┬───────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────────┐
  │     Crate      │                 Error types replaced                  │                            Downstream fixes                             │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-bitmap     │ 1 (ewah::decode::Error)                               │ none                                                                    │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-quote      │ 1 (ansi_c::undo::Error)                               │ none                                                                    │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-mailmap    │ 1 (parse::Error)                                      │ none                                                                    │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-fs         │ 1 (to_normal_path_components::Error)                  │ none                                                                    │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-lock       │ 1 (acquire::Error)                                    │ gix-testtools                                                           │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-path       │ 2 (relative_path::Error, realpath::Error)             │ gix-ref                                                                 │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-packetline │ 3 (encode::Error, decode::Error, decode::band::Error) │ none                                                                    │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-attributes │ 2 (name::Error, parse::Error)                         │ gix-pathspec                                                            │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-url        │ 3 (parse::Error, UrlParseError, expand_path::Error)   │ gix-transport, gix                                                      │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-hash       │ 7 (all error types)                                   │ gix-object, gix-pack, gix-odb, gix-index, gix-status, gix-protocol, gix │
  ├────────────────┼───────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────────┤
  │ gix-features   │ 3 (DecompressError, CompressError, inflate::Error)    │ (included in gix-hash downstream)                                       │
  └────────────────┴───────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────────┘
  Verification: cargo check -p gix passes, all 21 test suites across the 11 crates pass with 0 failures.

@loci-review
Copy link
Copy Markdown

loci-review bot commented Feb 23, 2026

Overview

This analysis evaluates commit e9e97d3, which migrates gix-fs from thiserror to gix-error. Across 30,870 functions, 1,864 were modified (6.0%), 4,607 added, and 4,626 removed.

Binaries analyzed:

  • target.aarch64-unknown-linux-gnu.release.gix: +0.014% power consumption (803,371.47 nJ → 803,482.38 nJ)
  • target.aarch64-unknown-linux-gnu.release.ein: -0.025% power consumption (296,296.35 nJ → 296,222.37 nJ)

Power consumption remains essentially neutral, indicating minimal impact on overall execution efficiency.

Function Analysis

Error Formatting Functions show 300-1,200% response time increases due to recursive error tree traversal in gix-error's Debug/Display implementations. Examples include gix_glob::pattern::Mode::fmt (+1,232%, 1.2μs → 15.9μs) and gix_merge::blob::Error::fmt (+538%, 2.5μs → 16.0μs). These affect only error/logging paths, not hot paths.

Error Destructor Functions show 400-600% throughput increases due to complex cleanup of Box<Frame> structures with recursive error trees. Validation error drops increased +585% (19ns → 133ns) and remote error drops +498% (29ns → 175ns). Absolute overhead remains sub-microsecond.

Performance-Critical Anomalies require investigation:

  • gix_features::parallel::in_parallel: +557% response time (117μs → 766μs), +1,114% throughput (330ns → 4,002ns) with zero source changes
  • gix_pack::objects: +515% response time (126μs → 776μs) with unchanged self-time, indicating downstream regression
  • gix_status::ReduceChange::feed: +609% response time (1.7μs → 12.3μs) with stable self-time

Pack Cache Operations show +2,238% throughput (15ns → 356ns) but only +4% response time (504ns → 525ns), suggesting compiler inlining changes rather than genuine regression.

Positive Optimization: crossbeam_channel::IntoIter::next improved -3.74% response time (65.6μs → 63.2μs) despite +742% throughput, indicating beneficial inlining.

Additional Findings

The severe regressions in parallel processing primitives (in_parallel, in_parallel_with_finalize) and pack operations (objects) lack source code justification. These functions are architecturally isolated from gix-fs changes, suggesting compiler optimization differences or build configuration variations between versions. Runtime profiling is recommended to validate whether static analysis predictions reflect real-world performance, as these functions are critical for pack operations and status computation identified in project insights.

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

@loci-dev loci-dev force-pushed the main branch 3 times, most recently from e746ced to fe5de3e Compare March 4, 2026 07:46
@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 2c4a72b to 167bdd1 Compare March 13, 2026 07:48
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from 3deba97 to 9b41e5f Compare March 18, 2026 07:49
@loci-dev loci-dev force-pushed the loci/pr-2443-gix-error branch from e9e97d3 to 671b892 Compare March 18, 2026 08:10
Replace the thiserror-derived `to_normal_path_components::Error`
enum with `gix_error::Exn<gix_error::Message>`.

Co-Authored-By: Sebastian Thiel <sebastian.thiel@icloud.com>
Co-authored-by: chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from f1896c0 to 0223bcb Compare March 23, 2026 07:52
@loci-dev loci-dev force-pushed the loci/pr-2443-gix-error branch from 671b892 to c8f3707 Compare March 23, 2026 08:15
@loci-dev loci-dev force-pushed the main branch 6 times, most recently from 06bc48e to 0e47b1e Compare March 30, 2026 07:05
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from 8b02847 to 1bf0519 Compare April 2, 2026 07:54
@loci-dev loci-dev force-pushed the main branch 3 times, most recently from cdbe120 to 78a7ab5 Compare April 11, 2026 07:49
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