Skip to content

UPSTREAM PR #2508: Allow checkouts of empty repositories#41

Open
loci-dev wants to merge 7 commits intomainfrom
loci/pr-2508-feat-allow-empty-dir
Open

UPSTREAM PR #2508: Allow checkouts of empty repositories#41
loci-dev wants to merge 7 commits intomainfrom
loci/pr-2508-feat-allow-empty-dir

Conversation

@loci-dev
Copy link
Copy Markdown

Note

Source pull request: GitoxideLabs/gitoxide#2508

This line effectively prevented checking out in non-empty directories in all cases.

@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 10, 2026

Flame Graph: target.aarch64-unknown-linux-gnu.release.gix::gix__ZN87_$LT$gix_filter..driver..process..client..invoke..Error$u20$as$u20$core..fmt..Debug$GT$3fmt

Target version:

Flame Graph: target.aarch64-unknown-linux-gnu.release.gix::gix__ZN87_$LT$gix_filter..driver..process..client..invoke..Error$u20$as$u20$core..fmt..Debug$GT$3fmt

The base version uses specialized std::io::Error formatting with efficient string operations and UTF-8 conversion (4-level depth). The target version switches to generic reference formatting with expensive pad_integral (3,415 ns) and do_count_chars (2,191 ns) operations, causing the 13x slowdown. This compiler code generation change affects multiple Debug trait implementations but only impacts error display paths.

💬 Questions? Tag @loci-dev

@loci-dev loci-dev force-pushed the loci/pr-2508-feat-allow-empty-dir branch from dfadc8b to e6727f1 Compare April 14, 2026 07:05
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 14, 2026

Overview

Analysis of 29,072 functions across two Gitoxide binaries shows stable overall performance. 837 functions modified (2.9%), 2,744 new, 2,744 removed, 22,747 unchanged. Changes stem from 3 commits focused on checkout functionality (empty repository support, destination folder validation).

Binaries analyzed:

  • target.aarch64-unknown-linux-gnu.release.gix: -0.015% power consumption
  • target.aarch64-unknown-linux-gnu.release.ein: +0.004% power consumption

Function Analysis

Performance-critical improvements (compiler optimizations, no source changes):

  • gix::revision::spec::parse::Delegate::find_ref (gix): -14.6% throughput (-27.82ns), -0.9% response
  • gix_traverse::commit::Simple::sorting (gix): -9.9% throughput (-40.72ns), response stable
  • gix_traverse::commit::Simple::filtered (gix): -8.7% throughput (-40.71ns), -2.0% response
  • gix::object::Object::peel_to_commit (gix): -7.0% throughput (-7.17ns), -0.9% response

Debug formatter changes (error paths only, negligible impact):

  • gix_filter::driver::process::client::invoke::Error::fmt (gix): +1,225% response (+59,624ns) — compiler switched to generic formatter (13.5x slower) but only affects error reporting
  • gix_transport::client::git::blocking_io::connect::Error::fmt (gix): +1,216% response (+59,618ns) — same pattern
  • gix_filter::driver::process::client::handshake::Error::fmt (gix): -92.3% response (-59,172ns) — thiserror v2.0 upgrade improved formatting

Dependency-driven changes:

  • jiff::fmt::friendly::printer::FractionalPrinter::print (gix): -50.7% throughput (-371ns) — upstream jiff optimization eliminated SIMD overhead
  • h2::hpack::decoder::Decoder::decode (gix): +37.3% response (+30,564ns) — h2 crate added safety mechanisms, affects HTTP/2 header processing only

Checkout-related function:

  • gix::clone::PrepareCheckout::persist (gix): +7.3% throughput (+4.22ns), +0.037% response — trivial regression in once-per-clone operation

Other analyzed functions showed minor compiler optimization improvements with no source changes.

Additional Findings

Source code changes limited to 4 files in checkout subsystem. No modifications to performance-critical areas (object database, pack operations, diff algorithms, network transport). Debug formatter regressions have large percentages but negligible absolute impact (60-65µs) as they execute only during error reporting. Core Git operations unaffected.

💬 Questions? Tag @loci-dev

@loci-dev loci-dev force-pushed the main branch 2 times, most recently from efe2b63 to 51a12b8 Compare April 15, 2026 07:06
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 15, 2026

Overview

Analysis of 29,199 functions across 5 commits focused on checkout functionality improvements. Power consumption changes are negligible: target.aarch64-unknown-linux-gnu.release.gix improved 0.004% (806,418 nJ → 806,389 nJ), target.aarch64-unknown-linux-gnu.release.ein regressed 0.009% (300,702 nJ → 300,729 nJ). Function changes: 924 modified, 2,875 new, 2,873 removed, 22,527 unchanged.

Function Analysis

Error Formatting Functions (Not Performance-Critical)

Multiple Debug trait implementations show large percentage changes but execute only during error conditions:

  • gix_filter::driver::process::client::invoke::Error::fmt (gix): +1,224% response time (4,869 ns → 64,493 ns), +1.2% throughput time. Compiler switched from specialized std::io::error::Repr::fmt (4,781 ns) to generic formatter (64,404 ns).
  • gix_transport::client::git::blocking_io::connect::Error::fmt (gix): +1,216% response time (4,904 ns → 64,523 ns). Same compiler code generation change.
  • gix_filter::driver::process::client::invoke::Error::fmt (ein): +188% response time (4,889 ns → 14,080 ns). Generic formatter with 4x more field operations.

Inverse pattern observed in handshake errors:

  • gix_filter::driver::process::client::handshake::Error::fmt (gix): -92% response time (64,082 ns → 4,908 ns). Eliminated expensive pad_integral operations.
  • gix_filter::driver::process::client::handshake::Error::fmt (ein): -65% response time (14,170 ns → 4,909 ns). Switched to optimized repr_bitpacked formatter.

Configuration and Initialization

gix::config::cache::incubate::load_config (gix): +23.8% response time (1,822 ns → 2,254 ns), +14.9% throughput time. Added control flow complexity with new consolidation block and tracing instrumentation overhead. Called during repository initialization, not in hot paths.

Commit Traversal (Performance-Critical)

  • gix_traverse::commit::Simple::sorting (gix): Stable response time (1,047 ns), -9.6% throughput time (412 ns → 373 ns). Helper function queue_to_vecdeque optimized.
  • gix_traverse::commit::Simple::filtered (gix): -2.0% response time (2,026 ns → 1,986 ns), -8.5% throughput time. Compiler optimizations in function's own code.

CLI Error Handling (External Dependency)

  • clap_builder::Error::invalid_utf8 (ein): +9.2% response time (2,852 ns → 3,114 ns), +30.7% throughput time. Added explicit resource cleanup (drop_in_place) and retry/recovery logic for correctness.
  • clap_builder::Error::missing_required_argument (ein): -5.2% response time (7,856 ns → 7,447 ns), -25.4% throughput time. Compiler optimizations with better code layout.

Other analyzed functions (revision parsing, clone operations, object database error handling) showed minor improvements or negligible changes.

Flame Graph Comparison

The following flame graphs illustrate the compiler code generation change in error formatting that caused the largest percentage regression:

Base version:
Flame Graph: target.aarch64-unknown-linux-gnu.release.gix::gix__ZN87_$LT$gix_filter..driver..process..client..invoke..Error$u20$as$u20$core..fmt..Debug$GT$3fmt

Target version:
Flame Graph: target.aarch64-unknown-linux-gnu.release.gix::gix__ZN87_$LT$gix_filter..driver..process..client..invoke..Error$u20$as$u20$core..fmt..Debug$GT$3fmt

Base version uses 4-level hierarchy with specialized field formatting, while target uses 3-level structure with expensive pad_integral (3,415 ns) and do_count_chars (2,191 ns) operations. This compiler optimization trade-off affects only error reporting scenarios.

Additional Findings

No source code changes detected in most affected functions—performance variations stem from compiler code generation differences. The checkout functionality improvements (allowing empty repositories, non-empty destinations) successfully add new capabilities without impacting performance-critical paths: object access (gix-odb), pack operations (gix-pack), and diffing (gix-diff) remain stable. Commit traversal shows minor improvements beneficial for history operations.

💬 Questions? Tag @loci-dev

@loci-dev loci-dev force-pushed the main branch 4 times, most recently from 49231d8 to bc0a777 Compare April 20, 2026 07:18
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 21, 2026

The analysis encountered an error. Please review the Processing Details for more information.

1 similar comment
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 21, 2026

The analysis encountered an error. Please review the Processing Details for more information.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 22, 2026

The analysis encountered an error. Please review the Processing Details for more information.

1 similar comment
@loci-review
Copy link
Copy Markdown

loci-review Bot commented Apr 22, 2026

The analysis encountered an error. Please review the Processing Details for more information.

@loci-dev loci-dev force-pushed the main branch 2 times, most recently from 1c8b114 to e902b63 Compare April 26, 2026 07:07
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from c6739bc to 6f67b12 Compare April 29, 2026 07:20
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