Rename command is very slow

Hi,

I have to rename thousands of files in TFS. So I wrote a small tool to do it. However I found it performed very poorly. It took 5 minutes to rename 200 files. I have tried using tf.exe command and the VersionControl API. Both of them are very slow. Is it a known issue?

Thanks,
Heng-yi

[322 byte] By [Heng-yiLiu] at [2007-12-24]
# 1
Rename is slow but notthat slow :) Here's what I tried:

[navigate to an empty, mapped folder]
for /l %a in (1, 1, 1000) do (echo foo > %a.txt)
tf add . /r
tf checkin . /r /i
for %a in (*) do (echo ren %a %a-ren >> test.tfc)
tf @test.tfc
tf checkin /i

The bulk rename took about 5 minutes, the checkin about 15 seconds. My guess is the perf team would consider that "good enough." We don't really anticipate bulk renames being a common operation. Nevertheless, the server rearchitecture work we're doing might improve things in the future -- I can find out what the vNext perf goals are if you like.

RichardBergMSFT at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 2

Hi,

It's actually a lot worse. I let the rename command run overnight. The following is the result I got back in the morning. I ran 6 batches of tf.exe command.

Rename 353 files: 50 minutes
Rename 353 files: 42 minutes
Rename 353 files: 76 minutes
Rename 388 files: 185 minutes
Rename 388 files: 288 minutes
Rename 388 files: 363 minutes

In the beginning of the rename command I watched the CPU usage in the TFS machine (single machine config). The sqlservr.exe CPU usage is always at 25%. And now after the rename is finished, it's on 50% constantly. (The warehouse status is Idle).

Heng-yi

Heng-yiLiu at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 3
Hmm. I've tested some more too and run into some severe slowdowns myself. Rename perf seems to depend heavily on the # of pending changes in the workspace. You might try pending X renames, checkin, then pending the next X renames, checkin, etc. (where X is somewhere between 10-100, based on a few tests I've run) Another option if perf is important would be to create lots of workspaces and split up the work so it can be done in parallel.
RichardBergMSFT at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 4
I've reminded the perf team of the issue -- we had the bug in our database but hadn't revisited it since v1. Hopefully it will be addressed in time for vNext. Thanks for bringing this [back] to our attention.
RichardBergMSFT at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...
# 5

Another problem is once you have 2000 pending rename files in the workspace, the Get Latest command will just hang. I'll try to use your suggestion to rename files. Thanks.

Heng-yi

Heng-yiLiu at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...

Visual Studio Team System

Site Classified