git - __git_ps1 extremely slow in kernel tree -


$ time __git_ps1 ((v2.6.33.4)) real    0m1.467s user    0m0.864s sys  0m0.564s 

it's making prompt unusable; on other hand, though, it's useful feature give lightly. idea why runs slow , can it?

setup details:

$ uname -a linux martin-laptop 2.6.35-22-generic #35-ubuntu smp sat oct 16 20:36:48 utc 2010 i686 gnu/linux  $ git --version git version 1.7.1  $ du -sh . 876m    . 

i suspect machine since on coworker's box, in kernel tree cloned from, same command returns instantly

$ time __git_ps1 ((v2.6.33.4)) real    0m0.039s user    0m0.008s sys 0m0.016s 

adding hdparm output:

mine

$ sudo hdparm -tt /dev/sda4  /dev/sda4:  timing cached reads:   1542 mb in  2.00 seconds = 772.35 mb/sec  timing buffered disk reads:  110 mb in  3.02 seconds =  36.42 mb/sec 

coworker's

$ sudo hdparm -tt /dev/sda6  /dev/sda6:  timing cached reads:   1850 mb in  2.00 seconds = 926.03 mb/sec  timing buffered disk reads:  210 mb in  3.02 seconds =  69.53 mb/sec 

other differences: coworker running git 1.6.5, i'm running 1.7.1

it turned out combination of 2 things:

i using

export git_ps1_showdirtystate=true export git_ps1_showuntrackedfiles=true 

by default. proved unusable on tree size of kernel. removing these options removes bit of nice functionality __git_ps1, @ least returns instantly now. (useful lesson - try out stuff freshly created user account before else.)

also, hard disk on work machine plain slow, wasn't git problem per se; it's first time obtruded upon notice.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -