On Tue, Feb 21, 2023 at 9:34 AM Junio C Hamano <gitster@xxxxxxxxx> wrote: > > "John Cai via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes: > > > When a repository contains different kinds of files, it may be desirable to > > use different algorithms based on file type. This is currently not feasible > > through the command line or using git configs. However, we can leverage the > > fact that gitattributes are path aware. > > ... > > To address some of the performance concerns in the previous series, a > > benchmark shows that now only a minor performance penalty is incurred, now > > that we are no longer adding an additional attributes parsing call: > > > > $ echo "*.[ch] diff=other" >> .gitattributes $ hyperfine -r 10 -L a > > git-bin-wrapper,git '{a} -c diff.other.algorithm=myers diff v2.0.0 v2.28.0' > > Benchmark 1: git-bin-wrapper -c diff.other.algorithm=myers diff v2.0.0 > > v2.28.0 Time (mean ± σ): 716.3 ms ± 3.8 ms [User: 660.2 ms, System: 50.8 ms] > > Range (min … max): 709.8 ms … 720.6 ms 10 runs > > > > Benchmark 2: git -c diff.other.algorithm=myers diff v2.0.0 v2.28.0 Time > > (mean ± σ): 704.3 ms ± 2.9 ms [User: 656.6 ms, System: 44.3 ms] Range (min … > > max): 700.1 ms … 708.6 ms 10 runs > > > > Summary 'git -c diff.other.algorithm=myers diff v2.0.0 v2.28.0' ran 1.02 ± > > 0.01 times faster than 'git-bin-wrapper -c diff.other.algorithm=myers diff > > v2.0.0 v2.28.0' > > Hopefully this round can immediately be merged down to 'next'? > Thanks. I'll leave that up to you and John, but are we risking merging code that could go unused or that we need to fundamentally change? I don't see how to handle the issues over at https://lore.kernel.org/git/647D3D49-B85B-4B66-A857-695CFF9685EE@xxxxxxxxx/ (not that I've spent much thought on it besides asking how things are going to work), and would be worried that we'd end up needing to change the mechanism somehow to cover the things John ultimately wants.