Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #14252 - epage:du-less, r=ehuss
perf(source): Don't `du` on every git source load ### What does this PR try to resolve? When profiling Zed (#14238), a major factor in their no-op run times is git patches and git dependencies. The slowest operation for each git source is running `du`. This is extraneous for a couple of reasons - GC isn't stable, slowing people down for a feature they aren't using - Size tracking was expected to be lazy, only reading sizes when the GC is configured for size, while this was eager - Git checkouts are immutable but we check on every load - This optimized for "while filesystem caches are warm" from a checkout operation when checkout operations are rare compared to all of the other commands run on a working directory. This removes the `du`, relying on the lazy loading that happens in `update_null_sizes`. For Zed, this removed about 40ms total from the runtime. While by itself, this is below the threshold of being noticed, - It adds up if any editor integrations are calling `cargo metadata` a lot - Over time, small gains like this will add up ### How should we test and review this PR? ### Additional information cc `@ehuss`
- Loading branch information