git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git diff too slow for a file
@ 2010-03-29  1:42 SungHyun Nam
  2010-04-17 15:52 ` René Scharfe
  0 siblings, 1 reply; 12+ messages in thread
From: SungHyun Nam @ 2010-03-29  1:42 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1250 bytes --]

Hello,

If I run a attached script for bunzipped attached files, I get:
(To reduce size, I removed many lines and bzipped.)

     $ ./mk.sh
     time diff -u x3 x4 >/dev/null 2>&1

     real	0m0.011s
     user	0m0.000s
     sys	0m0.010s

     time git diff >/dev/null 2>&1

     real	0m0.193s
     user	0m0.190s
     sys	0m0.000s

     $ git version
     git version 1.7.0.2.273.gc2413

     $ diff --version
     diff (GNU diffutils) 2.8.1
     ...

Well, though the files are ascii file, they includes a random
hexa-decimal datas, so that I don't interest the diff result at
all.  But the real problem is 'rebasing took so long if the file
was changed'.  Because the git tree includes several such a file,
if they changed, rebase took some miniutes for every branch.
Such a branch includes a few lines of changes for a C source file,
though.  Now I'm waiting an hour to finish rebasing all the
branches and yet a rebasing script is running... :-(

Please help!
Thanks,
namsh

The original file has more than 180000 lines and the result is:
     $ ./mk.sh
     time diff -u x3 x4 >/dev/null 2>&1

     real	0m0.759s
     user	0m0.740s
     sys	0m0.010s

     time git diff >/dev/null 2>&1

     real	0m44.460s
     user	0m44.390s
     sys	0m0.030s


[-- Attachment #2: x3.bz2 --]
[-- Type: application/octet-stream, Size: 3348 bytes --]

[-- Attachment #3: x4.bz2 --]
[-- Type: application/octet-stream, Size: 2088 bytes --]

[-- Attachment #4: mk.sh --]
[-- Type: text/plain, Size: 298 bytes --]

#!/bin/bash

run_command()
{
    echo "$@"
    eval "$@"
}

run_command 'time diff -u x3 x4 >/dev/null 2>&1'

{
    rm -rf u
    mkdir u
    cd u
    cp ../x3 x
    git init
    git add .
    git ci -m x
    cp ../x4 x
} >/dev/null 2>&1

echo ''
run_command 'time git diff >/dev/null 2>&1'

exit 0

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-05-04 22:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29  1:42 git diff too slow for a file SungHyun Nam
2010-04-17 15:52 ` René Scharfe
2010-04-17 17:10   ` Junio C Hamano
2010-04-18 18:01     ` René Scharfe
2010-04-20  7:40       ` Junio C Hamano
2010-04-20 21:15         ` René Scharfe
2010-04-21  2:49           ` Junio C Hamano
2010-05-02 13:04         ` René Scharfe
2010-05-02 15:10           ` Junio C Hamano
2010-05-04 20:16             ` René Scharfe
2010-05-04 22:56               ` Junio C Hamano
2010-04-19  0:43   ` SungHyun Nam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).