Thursday, September 27, 2007

TortoiseSVN's "Noisy" TSVNCache.exe

A co-worker of mine pointed me to a post by Travis Illig on his blog titled "Optimize Tortoise SVN Cache (TSVNCache.exe) Disk I/O"

A short synopsis:



TortoiseSVN has a shell-overlay that indicates the status of your files and folders within an SVN 'working folder'.

The background process that 'watches' your file system for SVN-related files and folders is TSVNCache.exe.

TSVNCache.exe, according to Travis, was bogging his system down with disk I/O.

Instead of disabling TSVNCache.exe entirely (and thereby disabling the icon-overlays) he found a way to limit what TSVNCache.exe 'watches' on the file system.


When I first read his post, I thought "How bad can TSVNCache.exe be?" So, as noted in the comments of Travis' post, I grabbed FileMon from SysInternals, and fired it up. After setting a filter so it would only display TSVNCache.exe-related events, I was amazed at just how much 'noise' it was causing -- and I wasn't doing anything at all! Just sitting there watching FileMon do it's thing.

What really caught my eye was when I sent my coworker an instant message, thanking him for the link. My IM client wrote the message to it's log file, and I saw TSVNCache note the change, and check the log file's location for the existence of a ".svn" folder. (The existence of such a folder would indicate that the folder is an SVN working folder.)

I was surprised to say the least, and wanted to see how bad it really got. I 'putzed ' around doing a whole lot of nothing other than navigating around my file system. I seemed ridiculous at just how much disk I/O TSVNCache.exe was inducing.

For example, look at the following screen shot. It's the TSVNCache activity imposed when I copied a folder on my desktop, which contains one file:



Thankfully, by limiting which folders TSVNCache.exe 'watches' you can greatly limit this superfluous disk I/O. In case you still haven't taken a moment to click-through and read Travis' post, here's the quick run-down:


  1. Open your TortoiseSVN settings (Right-click the desktop, TortoiseSVN -> Settings)

  2. Go to the "Icon Overlays" item in the treeview.

  3. Add "C:\*" to the "Exclude Paths" box

  4. Add the folders you do want included in the "Include Paths" box
    • I entered my 'work' folder: "C:\Work\*", for example.

  5. Save changes : Apply/Ok

  6. Restart TSVNCache.exe - kill TSVNCache.exe in your Task Manager. It will automatically restart when you open a Windows Explorer.




With these changes in place, within FileMon, you'll notice that TSVNCache is a lot less noisy. It will still receive "Change Notify" messages, but you won't see it access files/folders outside of your specified "Include" list.


Thanks for the great tip, Travis!

Tuesday, September 18, 2007

Diff / Merge Tools


I've been using TortoiseMerge (part of TortoiseSVN) for a while now to view my source's diff's as well as handling merge conflicts. Something about it though has always felt 'clunky' to me. It may just be it's default color scheme that causes my mental detraction, but when I saw Larkware plug something call DiffMerge 3.1 beta I figured I should give it a try.



So far, I like it. It's UI is more sexy, as far as I'm concerned. It supports 3-way merging (like TortoiseMerge), making life so much easier when resolving merge conflicts. It supposedly supports folder diff/merging, although I haven't tried that yet.

I just wish I hadn't also accidentally stumbled upon another free diff/merge tool called KDiff3. I like KDiff3's shell context menu for it's ability to 'remember' a file's location on the file system. Once a file is 'remembered', you can perform a diff on any other file on the system by asking KDiff3 to compare the current file you have in front of you, and one of the 'remembered' files from earlier. (I've found myself needing to do this lately and KDiff3 definitely speeds up the process.)

One other thing I liked about KDiff3 was in it's installer: It provided an install option to integrate with TortoiseSVN as Tortoise's primary diff/merge tool.

The only problem with KDiff3 was, it's color scheme made me throw up in my mouth so fast that I quickly decided I had to give DiffMerge another shot. (The screenshot shown here doesn't truly show off the vomit-in-mouth colors so much...) KDiff's ability to integrate easily with TortoiseSVN got me looking into how to set DiffMerge as my Tortoise diff/merge tool.

Being perpetually low on free time, and not wanting to figure out the command line options myself, I enlisted Google to give me answers. In my search for integrating DiffMerge as my TortoiseSVN diff/merge tool, I ran into this post by 'Trumpi' detailing exactly how to integrate the two! So, instead of outright stealing from Trumpi, I give you: Trumpi's blog : SourceGear release DiffMerge.

...
Ok, I'll steal a little, only because I tweaked my settings slightly for the diff-tool specification (caught the tweak in Trumpi's post comments). Here's the command lines for specifying DiffMerge as your diff and merge tools for TortoiseSVN:
  • Diff:
    • New way: (see comments)
      C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe /ro2 /t1=%bname /t2=%yname %base %mine
    • Old way:
      C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe /t1=Base /t2=Mine %base %mine

  • Merge:
    • New Way: (see comments)
      C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe /r=%merged /t1=%yname /t2=%bname /t3=%tname /c=%mname %mine %base %theirs
    • Old Way:
      C:\Program Files\SourceGear\DiffMerge\DiffMerge.exe /t1=Mine /t2=Base /t3=Theirs /r=%merged %mine %base %theirs



Update:

Note on the updated TortoiseSVN external tool commands: In the comments, Travis mentioned that I should RTFM. Upon inspecting the DiffMerge manual, I came up with the updated command lines above. I especially appreciate the "/ro2" option for the diff-tool. This makes DiffMerge act strictly like a diff-tool (ie: no editing allowed.)

Also, I gave Jimmy's WinMerge a try. It does fit my 'eye-candy' requirement, but I just can't devote more time to it because of it's lack of 3-way merging.

Wednesday, September 05, 2007

Google Earth update

Hey, did anyone else notice the cool additions they made in Google Earth?

Check Out The Details Here.

Of special note, you can now flip-around and view the sky from your current location on Google Earth! This is really cool. There is also a built-in flight simulator. It's pretty easy to crash in the flight sim, so, I didn't really play much with it, just the 'view sky' mode.

Anyway... Quick post!