gitui icon indicating copy to clipboard operation
gitui copied to clipboard

Interactive Blame doesn't appear to be as fast as tig or non-interactive git blame

Open rnk opened this issue 9 months ago • 7 comments

Hi, I came to check out this project because I'm looking for a tool for command line interactive blame. I do a lot of source code archaeology , and I would like a single key-press way to go back to the commit that introduced the line in my cursor. As an LLVM developer, I was super excited to try out a project advertised as "blazing fast Rust". :)

However, I ran gitui blame on llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp, (helpfully github says "(Sorry about that, but we can’t show files that are this big right now.)") and it's still going as I type out this issue / feature request. This isn't a bug so much as, if you are interested in doing further performance engineering and looking for a workload to benchmark, profile, and optimize, I think you should consider this one.

This source file may be a crime against software engineering, but I will say I've done my part to move code out of it, although it was almost entirely done in self-interest.

rnk avatar Mar 30 '25 02:03 rnk

yeah its a known issue with the underlying git implementation, see https://github.com/gitui-org/gitui/issues/673 and upstream https://github.com/libgit2/libgit2/issues/3027 but I am hopeful that we might soon have a contender with gitoxide to migrate to: https://github.com/GitoxideLabs/gitoxide/commit/6ed9976abaa3915b50efa46c46b195f3a1fc4ff7

extrawurst avatar Mar 30 '25 06:03 extrawurst

cc @cruessler is gitoxide on par with libgit2 or better yet? :)

extrawurst avatar Mar 30 '25 06:03 extrawurst

The latest numbers I have are that gitoxide blame has gotten quite close to git, but hasn’t reached its performance yet. I don’t know about libgit2, but I definitely want to try integrating gitoxide blame into gitui soon to find out. :-)

cruessler avatar Mar 30 '25 07:03 cruessler

@cruessler close to git means for sure faster than libgit2 as this is a magnitude slower than regular git. Using the gitoxide based one then would be a huge win!!

extrawurst avatar Mar 30 '25 07:03 extrawurst

That’s great news, and thanks for the info! I’ll move trying this out up in my list of priorities, then!

cruessler avatar Mar 30 '25 07:03 cruessler

Very promising fresh benchmarks: https://github.com/gitui-org/gitui/pull/2269#issuecomment-2776123903

extrawurst avatar Apr 03 '25 17:04 extrawurst

@rnk If you want, you can try the in-progress PR #2591 to see whether it speeds up things for you. On my machine, it was so much faster for complex file histories that I wasn’t sure I could trust the benchmarks. 😄

cruessler avatar Apr 17 '25 14:04 cruessler