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
Rename is slow but not
that 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.
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
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.