tags:

views:

38

answers:

2

I am running an Ubuntu Lucid guest inside VMWare Player on a Windows XP machine, using a shared folder. git status is slow in the VM (24 seconds) but fast on the host machine (0.06 seconds) Any idea why?

More details:

  • My repo is about 620 MB (obtained by doing du -hs . in the guest OS)
  • I've tried running git gc as described here, but it made no difference:

Counting objects: 3604, done.

Compressing objects: 100% (1069/1069),

done. Writing objects: 100%

(3604/3604), done. Total 3604 (delta 2143), reused 3604 (delta 2143)

Removing duplicate objects: 100%

(256/256), done.

  • My repo contains lots of CSV files as well as code - is this a bad idea?
  • On Windows host I am using PortableGit-1.7.2.3-preview20100911
  • On Ubuntu guest I use Git version 1.7.0.4 installed from aptitude
  • On Ubuntu guest I am sharing a folder from the windows host using the VMWare shared folder facility
  • On Windows guest I have no choice but to have Sophos running, but I temporarily turned off "on-access scanning" and it made no difference.
  • I originally had problems with the guest clock running slow, but this was fixed with grub options nosmp noapic nolapic as described here.
+1  A: 

1/ Read access are generally slower through a VM than a native OS

2/ git status is slow when the repo has submodules: do you have any?
With git1.7.2+, you can ignore those with the --ignore-submodules option.

VonC
The slowdown in other aspects of the guest VM doesn't seem anywhere near the same amount (eclipse still seems pretty nippy to me), but perhaps git status does a lot more work. I don't think I've any submodules. Am new to git, but have only imported a single SVN project using the github guide at http://help.github.com/svn-importing/
Pengin
@Pengin: then you shouldn't have any submodules, but it would be worth trying to upgrade the git version on the guest VM though, and see if the issue persists.
VonC
+1  A: 

Shared Folders have a fair amount of overhead, since you're crossing the guest<>host boundary. I'm not super-familiar with the internals of git, but I would assume it does a lot of fairly small operations, involving a relatively high amount of per-operation overhead. You could try doing a git repack to reduce the amount of individual objects (files), might help a bit.

Is it imperative that you share the repository between guest and host?

snemarch
Very interesting. I copied the repo into the guest file system and it had very little impact on the time to do `git status`. What was more interesting was that now the CPU usage widget indicated that it was wasting most of its time in IO, whereas before (when using shared filsystem) it was just 100% used.
Pengin
Upshot, I will just use the shared folders and run git on the windows host and not worry about it. Thanks very much for help.
Pengin