Am 30.05.19 um 13:55 schrieb Jeff King: > On Wed, May 29, 2019 at 07:54:44PM +0200, René Scharfe wrote: > >> Am 29.05.19 um 03:17 schrieb Jeff King: >>> But here the problem is in the tree, not the blob. So we're not finding >>> suspect blobs, but rather re-checking each tree. And no matter what we >>> do (whether it's visiting the object again, or creating a set or mapping >>> with the object names) is going to be linear there. And a repository >>> with a symlink in the root tree is going to revisit or put in our >>> mapping every single root tree. >> >> That's true, potentially it needs remember and/or reprocess all trees, >> meaning this check may double the run time of fsck in the worst case. >> Example from the wild: The kernel repo currently has 36 symlinks and >> 6+ million objects are checked in total, and the symlink check processes >> 18943 trees_with_symlinks entries there. > > That sounds about right. It's basically every version of every tree that > has a symlink. Did it make a noticeable difference in timing? Indexing > the whole kernel history is already a horribly slow process. :) Right, I didn't notice a difference -- no patience for watching that thing to the end. But here are some numbers for v2.21.0 vs. master with the patch: Benchmark #1: git fsck Time (mean ± σ): 307.775 s ± 9.054 s [User: 307.173 s, System: 0.448 s] Range (min … max): 294.052 s … 322.931 s 10 runs Benchmark #2: ~/src/git/git fsck Time (mean ± σ): 319.754 s ± 2.255 s [User: 318.927 s, System: 0.671 s] Range (min … max): 316.376 s … 323.747 s 10 runs Summary 'git fsck' ran 1.04 ± 0.03 times faster than '~/src/git/git fsck' Seeing only a single CPU core being stressed for that long is a bit sad to see. Checking individual objects should be relatively easy to parallelize, shouldn't it? René