delta: šŸ› delta is much slower starting with `0.10.3` (`0.11.0` included)

delta is much slower for me starting from 0.10.3. I was able to reproduce that without any gitconfig customizations. I will try to add a docker command to reproduce this, but wanted to open an issue in case others run into this.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 2
  • Comments: 59 (25 by maintainers)

Commits related to this issue

Most upvoted comments

Currently, I use my self build with this commit

ttys3@d147fe6

works fine.

@ttys3 than you very much for your investigation! The downside of disabling that call is that delta will not be able to handle any of the following:

  • git diff --word-diff / git diff --color-words
  • git grep and other grep’s (but it will handle rg --json)
  • git show $commit:$file
  • git blame language detection

So that would be a shame, and I’d like to find a solution whereby we can do the process inspection in a way that is fast for all users.

I’ve released 0.11.2 which should fix this, but with the cost that in some situations the calling process won’t be identified (identification of calling process is needed for --word-diff/--color-words, git grep, git show $commit:$file, git blame).

If anyone can confirm that the problem is not present on 0.11.2 that would be great.

I can definitely bisect it, shouldn’t take too long. Will get to that by tomorrow. Lease I can do to give back a little bit to fantastic OSS

I wonder what is going on with the difference between hyperfine and your shell function. I’d be interested to see each of the 10 timings that are being averaged by your shell function, to see what the distribution is like.

I’ve used your shell function, and hyperfine, on delta src/delta.rs src/paint.rs on intel and M1 MacOS and there’s no difference similar to what you see.

(I did, I am fairly certain, discover the interesting but irrelevant fact that the binary from homebrew is 1.5x faster on the M1 machine than cargo build --release – I want to know why!)

I was able to reproduce a 10x slowdown with docker (the issue was related to the stdin stuff). @dandavison can you see if this reproduces for you as well?

@infokiller I’ve run your docker-based script now and yes I can reproduce your finding that delta is significantly slower when there are many processes (using ā€œDocker Desktopā€ on a Mac, i.e. in a Linux VM).

Running command "git diff --no-index a b | delta-0.10.2 >| delta-0.10.2-result" 10 times
71.20 ms per run (712 ms total)
Benchmarking version: 0.11.0
Running command "git diff --no-index a b | delta-0.11.0 >| delta-0.11.0-result" 10 times
463.00 ms per run (4630 ms total)
Benchmarking version: 0.11.2
Running command "git diff --no-index a b | delta-0.11.2 >| delta-0.11.2-result" 10 times
65.50 ms per run (655 ms total)

And I can also reproduce it directly on my Mac:

Running command "git diff --no-index a b | delta-0.10.2 >| delta-0.10.2-result" 10 times
107.60 ms per run (1076 ms total)
Benchmarking version: 0.11.0
Running command "git diff --no-index a b | delta-0.11.0 >| delta-0.11.0-result" 10 times
475.30 ms per run (4753 ms total)
Benchmarking version: 0.11.2
Running command "git diff --no-index a b | delta-0.11.2 >| delta-0.11.2-result" 10 times
108.50 ms per run (1085 ms total)

(Is that my cargo build --release binaries being slower again??)

Beautiful shell script by the way, thanks! I think I will be referring back to it / using it for future delta tests.

here you go. new issue opened: https://github.com/dandavison/delta/issues/839

to avoid duplicated comment, I’ve remove those duplicated in this one.

Yep can do, will report back what I see later today. Thanks for being on top of it!

Running arch, kernel 5.15.3-arch1-1. git version 2.34.1 in case that matters