views:

242

answers:

3

We have a project for a client that is written in VB.NET. In one of the projects, we have about 100 modules, which are all VERY simple. They're extension methods that convert between object types. Here is a small snippet:

Public Module ScheduleExtensions

<System.Runtime.CompilerServices.Extension()> _
Public Function ToServicesData(ByVal source As Schedule) As ScheduleServicesData
    If (source IsNot Nothing) Then
        Dim target As New ScheduleServicesData
        With target
            .CenterId = source.CenterId
            .EmployeeGuid = source.EmployeeGuid
            .EndDateTime = source.EndDateTime

The problem is, this project alone takes 2+ minutes to build. I ran diskmon and filemon, and it doesn't access the file system while the build appears to hang. The CPU usage is also low during the majority of the execution. After about 2 minutes, the build finishes and there is disk and CPU activity. The problem can be reproduced on any machine (4 tried so far).

I went so far as to compile the project using the vbc command line, and the problem is there as well.

Is there something about VB.NET extension methods that lead to poor compile time? That is the only feature we're using that is more complex than looping/getting/setting, etc.

A: 

It's hard to know what the problem would be based on a small sample like this. There is nothing inherently slow about extension method support in the compiler and we have numerous regression tests in this area. If there is a bug, it's likely a combination of several factors causing the problem.

If you have the time please file a bug on this issue at

It makes the bug much easier to investigate if you can provide a small sample which reproduces the problem.

JaredPar
+1  A: 

Performance problems that show no significant CPU or DISK activity are invariably related to Network waits, either network performance itself or, more likely, waiting for responses from Services on other systems. Now I do not see anything in the sample that should have that problem, so I must assume that the problem is coming from something else either in your project, or your project settings or your VS environment, or your system's environment.

You might try to get a tool that can monitor all network calls from your system and see what's going on.

RBarryYoung
A: 

It seems that I've a similar problem and I don't know how to troubleshoot it..

rafek