Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / February 2007

Tip: Looking for answers? Try searching our database.

TFS SDK => PendRename performance is abysmal

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Stuart Carnie - 05 Feb 2007 16:37 GMT
I am in the process of renaming ~2800 files, and it has been running all night.  Here is the code:

namespace UpdateMetadata
{
    class Program
    {
        static Workspace _ws;

        static void Main(string[] args)
        {
            TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("http://devtfserver:8080");
            Console.WriteLine("User: {0}", tfs.AuthenticatedUserName );

            VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof (VersionControlServer));
            _ws = vcs.GetWorkspace(@"<my local workspace folder>");
            DirectoryInfo di = new DirectoryInfo(@"<a subtree (containing the XML files to rename) of my local workspace>");
            ProcessDirectory(di);
        }

        static void ProcessDirectory(DirectoryInfo di)
        {
            FileInfo[] files = di.GetFiles();
            foreach (FileInfo file in files)
            {
                if (Path.GetExtension(file.Name).ToLower() != ".xml")
                {
                    string newName = file.FullName + ".xml";
                    Logger.Info("PendRename {0} => {1}", file.Name, Path.GetFileName(newName));
                    _ws.PendRename(file.FullName, newName);
                }
            }

            DirectoryInfo[] dirs = di.GetDirectories();
            foreach (DirectoryInfo dir in dirs)
            {
                ProcessDirectory(dir);
            }
        }
    }
}

It started off reasonably quickly - even over the VPN; however, it was still running 7 hours later when I awoke.  I started it
again at the office, with a direct connection to the server, however it is taking roughly 35-40 seconds to rename a file.  CPU
usage on my local machine is <1%, context switching is minimal.

It is evident that the server performance has significantly degraded over the duration of this operation, and therefore is the
cause of the performance issues - why?

Cheers,

Stuart
Stuart Carnie - 05 Feb 2007 17:52 GMT
We rebooted the server, to no avail.  On a colleagues machine, a rename was instantaneous yet still 40-50 seconds on my machine.
Turns out that TFS does not scale very well with too many pending changes (perhaps it is particular to renames).

After committing what I had, it was fast again.

> I am in the process of renaming ~2800 files, and it has been running all
> night.  Here is the code:
[quoted text clipped - 55 lines]
>
> Stuart
Stuart Carnie - 05 Feb 2007 17:52 GMT
We rebooted the server, to no avail.  On a colleagues machine, a rename was instantaneous yet still 40-50 seconds on my machine.
Turns out that TFS does not scale very well with too many pending changes (perhaps it is particular to renames).

After committing what I had, it was fast again.

> I am in the process of renaming ~2800 files, and it has been running all
> night.  Here is the code:
[quoted text clipped - 55 lines]
>
> Stuart

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.