Connecting to the internet causing slow build times
20 posts • Page 1 of 1
Connecting to the internet causing slow build times
Hello Gael,
I've wired up PostSharp into a dozen or so projects with great success. Our team is however, experiencing pretty slow compile times. A colleague here believes that it is because PostSharp is trying to make a connection to the internet and then continuing for each project within a solution that is being built. He has come to this conclusion because the firewall on his machine keeps popping up with a block / unblock message for each project.
We are using 1.0 RC3 (PostSharp.exe version - 1.0.9.372)
Now my colleague saw a discussion (after searching on google) where this was something that was happening in one of the versions of PostSharp and that the suggestion solution was to change some registry key to stop it. However, the way we have PostSharp setup is that we didn't use the installer but rather copied the relevant PostSharp files locally into each solution.
What doesn't help is that my colleague cannot find this link of the discussion so I am unable to look into it myself.
Anyway, the symptoms are that this PostSharp is trying to make an internet connection and that this is slowing the build. My colleague also says that it’s slower when compiling on a machine that uses a proxy server to get out onto the internet.
Anyway your help in turning this PostSharp configuration off would be much appreciated as it is hampering our Test driven development effort, which requires fast build (and unit tests) speeds.
Thanks
Christian Crowhurst
I've wired up PostSharp into a dozen or so projects with great success. Our team is however, experiencing pretty slow compile times. A colleague here believes that it is because PostSharp is trying to make a connection to the internet and then continuing for each project within a solution that is being built. He has come to this conclusion because the firewall on his machine keeps popping up with a block / unblock message for each project.
We are using 1.0 RC3 (PostSharp.exe version - 1.0.9.372)
Now my colleague saw a discussion (after searching on google) where this was something that was happening in one of the versions of PostSharp and that the suggestion solution was to change some registry key to stop it. However, the way we have PostSharp setup is that we didn't use the installer but rather copied the relevant PostSharp files locally into each solution.
What doesn't help is that my colleague cannot find this link of the discussion so I am unable to look into it myself.
Anyway, the symptoms are that this PostSharp is trying to make an internet connection and that this is slowing the build. My colleague also says that it’s slower when compiling on a machine that uses a proxy server to get out onto the internet.
Anyway your help in turning this PostSharp configuration off would be much appreciated as it is hampering our Test driven development effort, which requires fast build (and unit tests) speeds.
Thanks
Christian Crowhurst
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Hi Christian,
PostSharp makes one connection per week. If the connection did not succeed, it tries again the next day (not even the next build, but the next day). It makes it in a background thread, and this thread is terminated (killed) if it has not completed.
Therefore, the update check process cannot slow down the post-compilation process. Or at least, if it works at it is intended, it should not.
If you have doubts, you can use a debug build and enable the tracing of the "AutoUpdate" category (see in the documentation how to enable tracing). You can also check the algorithm in source code.
You can disable update check by setting the MSBuild property "PostSharpAutoUpdate" to "False". Please refer to documentation for details about that.
PostSharp makes one connection per week. If the connection did not succeed, it tries again the next day (not even the next build, but the next day). It makes it in a background thread, and this thread is terminated (killed) if it has not completed.
Therefore, the update check process cannot slow down the post-compilation process. Or at least, if it works at it is intended, it should not.
If you have doubts, you can use a debug build and enable the tracing of the "AutoUpdate" category (see in the documentation how to enable tracing). You can also check the algorithm in source code.
You can disable update check by setting the MSBuild property "PostSharpAutoUpdate" to "False". Please refer to documentation for details about that.
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Thanks for the reply Gael.
I'll follow your suggestions and let you know how I get on.
C
I'll follow your suggestions and let you know how I get on.
C
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Gael,
Just a quick question re compilation speed. Would you expect that a project (class library) that ordinarily takes 0.2 seconds to compile should take on average 3.1 seconds when PostSharp is enabled?
This is what I'm experiencing when I disable PostSharp using the SkipPostSharp compilation constant compared to when it is enabled and I am NOT weaving any aspects into the code.
Thanks
Christian
Just a quick question re compilation speed. Would you expect that a project (class library) that ordinarily takes 0.2 seconds to compile should take on average 3.1 seconds when PostSharp is enabled?
This is what I'm experiencing when I disable PostSharp using the SkipPostSharp compilation constant compared to when it is enabled and I am NOT weaving any aspects into the code.
Thanks
Christian
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Yes, this is possible, especially if you don't use the installer.
Most of the time is just starting the CLR, resolving assemblies, JIT compiling PostSharp, ...
There is a section about performance in the documentation.
Most of the time is just starting the CLR, resolving assemblies, JIT compiling PostSharp, ...
There is a section about performance in the documentation.
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Ok, maybe this is the problem. I am still digging into the times.
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Right I have run the debug build with tracing switched on. An exert from the msbuild output is at the bottom of this post.
I have also looked at the msbuild output for the same solution on our CruiseControl server. Now it looks like PostSharp is trying to get out onto the internet. And its doing it for every project in the solution and for every build that I've seen thus far.
Here's an example of the CruiseControl msbuild output that is strongly pointing to PostSharp trying to make an internet connection:
Target "PostSharp":
Creating directory "obj\Debug\Before-PostSharp".
Creating directory "obj\Debug\PostSharp".
"D:\<snip>\tools\PostSharp\PostSharp.exe" "D:\<snip>\tools\PostSharp\Default.psproj" "obj\Debug\Before-PostSharp\Eca.Commons.ObjectUtils.dll" "/P:Output=obj\Debug\Eca.Commons.ObjectUtils.dll " "/P:ReferenceDirectory=D:\D:\<snip>\src\Commons.ObjectUtils " "/P:Configuration=Debug " "/P:Platform=AnyCPU " "/P:SearchPath=..\..\bin\Debug\, " "/P:IntermediateDirectory=obj\Debug\PostSharp " "/P:CleanIntermediate=False " "/P:MSBuildProjectFullPath=D:\D:\<snip>\src\Commons.ObjectUtils\Commons.ObjectUtils.csproj " "/P:SignAssembly=False " "/P:PrivateKeyLocation= "
PostSharp 1.0 [1.0.9.373] - Copyright (c) Gael Fraiteur, 2005-2008.
info PS0092: Unexpected error during auto-update check: The remote server returned an error: (407) Proxy Authentication Required.
info PS0035: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe "D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.il" /QUIET /DLL /PDB "/RESOURCE=D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.res" "/OUTPUT=D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll" /SUBSYSTEM=3 /FLAGS=1 /BASE=4194304 /STACK=1048576 /ALIGNMENT=4096 /MDV=v2.0.50727
Touching D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll.postsharp.
Now here's an extract from msbuild running this same solution locally on my machine (which has not got PostSharp installed either):
PostSharp 1.0 [1.0.9.373] - Copyright (c) Gael Fraiteur, 2005-2008.
debug AutoUpdate: Starting.
debug AutoUpdate: The next check date is 07/09/2008 20:44:16.
debug AutoUpdate: Finished.
debug Remoting: Creating the PostSharp.Extensibility.RemotingAccessor`1[PostSharp.Extensibility.IPostSharpHost] with guid a4125c98-7043-48c5-b42a-6c9a0af9ad92.
debug Timings: Reflection assembly {Eca.Commons.ObjectUtils, Version=1.0.165.0, Culture=neutral, PublicKeyToken=null} loaded in 43 ms.
debug Timings: Assembly {Eca.Commons.ObjectUtils, Version=1.0.165.0, Culture=neutral, PublicKeyToken=null} loaded in 316 ms (lazyLoading=False)
debug Timings: XML Serializers were acquired in 4 ms.
debug Timings: File Default.psproj parsed in 0 ms.
debug Timings: File PostSharp-Platform.config parsed in 0 ms.
debug Timings: Application-level configuration loaded in 41 ms.
debug Timings: Tasks deserialized in 85 ms.
debug Timings: Task {DisableMessages} executed in 23 ms.
debug Timings: Phase {Load} executed in 26 ms.
debug Timings: Task {Globals} executed in 0 ms.
debug Timings: Assembly {mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089} loaded in 553 ms (lazyLoading=True)
debug Timings: Assembly {Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4} loaded in 5 ms (lazyLoading=True)
debug Timings: Task {IndexGenericInstances} executed in 693 ms.
debug Timings: Task {TypeHierarchyAnalysis} executed in 0 ms.
debug Timings: Assembly {System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089} loaded in 578 ms (lazyLoading=True)
debug Timings: Task {CustomAttributeDictionary} executed in 591 ms.
debug Timings: Assembly {PostSharp.Public, Version=1.0.9.372, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7} loaded in 5 ms (lazyLoading=True)
debug Timings: Task {MulticastAttribute} executed in 34 ms.
debug Timings: Task {AutoDetect} executed in 56 ms.
debug Timings: Phase {Analyze} executed in 1378 ms.
debug Timings: Phase {Transform} executed in 0 ms.
debug Timings: IL code generated in 403 ms.
info PS0035: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe "D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.il" /QUIET /DLL /PDB "/RESOURCE=D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.res" "/OUTPUT=D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll" /SUBSYSTEM=3 /FLAGS=1 /BASE=4194304 /STACK=1048576 /ALIGNMENT=4096 /MDV=v2.0.50727
debug Timings: ILASM executed in 250 ms.
debug Timings: Task {Compile} executed in 724 ms.
debug Timings: Phase {Generate} executed in 725 ms.
debug Timings: Project executed in 2137 ms.
debug Remoting: Disposing the PostSharp.Extensibility.RemotingAccessor`1[PostSharp.Extensibility.IPostSharpHost] with guid a4125c98-7043-48c5-b42a-6c9a0af9ad92.
debug Timings: Domain disposed in 5 ms.
So, I'm now not sure whether the time I'm seeing is what can be expected or whether the time is worse because PostSharp is stalling on the Proxy Authentication to return an error???
Any help would be appreciated!
Thanks
Christian
I have also looked at the msbuild output for the same solution on our CruiseControl server. Now it looks like PostSharp is trying to get out onto the internet. And its doing it for every project in the solution and for every build that I've seen thus far.
Here's an example of the CruiseControl msbuild output that is strongly pointing to PostSharp trying to make an internet connection:
Target "PostSharp":
Creating directory "obj\Debug\Before-PostSharp".
Creating directory "obj\Debug\PostSharp".
"D:\<snip>\tools\PostSharp\PostSharp.exe" "D:\<snip>\tools\PostSharp\Default.psproj" "obj\Debug\Before-PostSharp\Eca.Commons.ObjectUtils.dll" "/P:Output=obj\Debug\Eca.Commons.ObjectUtils.dll " "/P:ReferenceDirectory=D:\D:\<snip>\src\Commons.ObjectUtils " "/P:Configuration=Debug " "/P:Platform=AnyCPU " "/P:SearchPath=..\..\bin\Debug\, " "/P:IntermediateDirectory=obj\Debug\PostSharp " "/P:CleanIntermediate=False " "/P:MSBuildProjectFullPath=D:\D:\<snip>\src\Commons.ObjectUtils\Commons.ObjectUtils.csproj " "/P:SignAssembly=False " "/P:PrivateKeyLocation= "
PostSharp 1.0 [1.0.9.373] - Copyright (c) Gael Fraiteur, 2005-2008.
info PS0092: Unexpected error during auto-update check: The remote server returned an error: (407) Proxy Authentication Required.
info PS0035: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe "D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.il" /QUIET /DLL /PDB "/RESOURCE=D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.res" "/OUTPUT=D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll" /SUBSYSTEM=3 /FLAGS=1 /BASE=4194304 /STACK=1048576 /ALIGNMENT=4096 /MDV=v2.0.50727
Touching D:\D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll.postsharp.
Now here's an extract from msbuild running this same solution locally on my machine (which has not got PostSharp installed either):
PostSharp 1.0 [1.0.9.373] - Copyright (c) Gael Fraiteur, 2005-2008.
debug AutoUpdate: Starting.
debug AutoUpdate: The next check date is 07/09/2008 20:44:16.
debug AutoUpdate: Finished.
debug Remoting: Creating the PostSharp.Extensibility.RemotingAccessor`1[PostSharp.Extensibility.IPostSharpHost] with guid a4125c98-7043-48c5-b42a-6c9a0af9ad92.
debug Timings: Reflection assembly {Eca.Commons.ObjectUtils, Version=1.0.165.0, Culture=neutral, PublicKeyToken=null} loaded in 43 ms.
debug Timings: Assembly {Eca.Commons.ObjectUtils, Version=1.0.165.0, Culture=neutral, PublicKeyToken=null} loaded in 316 ms (lazyLoading=False)
debug Timings: XML Serializers were acquired in 4 ms.
debug Timings: File Default.psproj parsed in 0 ms.
debug Timings: File PostSharp-Platform.config parsed in 0 ms.
debug Timings: Application-level configuration loaded in 41 ms.
debug Timings: Tasks deserialized in 85 ms.
debug Timings: Task {DisableMessages} executed in 23 ms.
debug Timings: Phase {Load} executed in 26 ms.
debug Timings: Task {Globals} executed in 0 ms.
debug Timings: Assembly {mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089} loaded in 553 ms (lazyLoading=True)
debug Timings: Assembly {Iesi.Collections, Version=1.0.0.3, Culture=neutral, PublicKeyToken=aa95f207798dfdb4} loaded in 5 ms (lazyLoading=True)
debug Timings: Task {IndexGenericInstances} executed in 693 ms.
debug Timings: Task {TypeHierarchyAnalysis} executed in 0 ms.
debug Timings: Assembly {System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089} loaded in 578 ms (lazyLoading=True)
debug Timings: Task {CustomAttributeDictionary} executed in 591 ms.
debug Timings: Assembly {PostSharp.Public, Version=1.0.9.372, Culture=neutral, PublicKeyToken=b13fd38b8f9c99d7} loaded in 5 ms (lazyLoading=True)
debug Timings: Task {MulticastAttribute} executed in 34 ms.
debug Timings: Task {AutoDetect} executed in 56 ms.
debug Timings: Phase {Analyze} executed in 1378 ms.
debug Timings: Phase {Transform} executed in 0 ms.
debug Timings: IL code generated in 403 ms.
info PS0035: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\ilasm.exe "D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.il" /QUIET /DLL /PDB "/RESOURCE=D:\<snip>\src\Commons.ObjectUtils\obj\Debug\PostSharp\Eca.Commons.ObjectUtils.res" "/OUTPUT=D:\<snip>\src\Commons.ObjectUtils\obj\Debug\Eca.Commons.ObjectUtils.dll" /SUBSYSTEM=3 /FLAGS=1 /BASE=4194304 /STACK=1048576 /ALIGNMENT=4096 /MDV=v2.0.50727
debug Timings: ILASM executed in 250 ms.
debug Timings: Task {Compile} executed in 724 ms.
debug Timings: Phase {Generate} executed in 725 ms.
debug Timings: Project executed in 2137 ms.
debug Remoting: Disposing the PostSharp.Extensibility.RemotingAccessor`1[PostSharp.Extensibility.IPostSharpHost] with guid a4125c98-7043-48c5-b42a-6c9a0af9ad92.
debug Timings: Domain disposed in 5 ms.
So, I'm now not sure whether the time I'm seeing is what can be expected or whether the time is worse because PostSharp is stalling on the Proxy Authentication to return an error???
Any help would be appreciated!
Thanks
Christian
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
There is maybe a bug with the auto-update, because this exception does not cause the next retry to be next day, as it should. It is because I expect the exception to be WebException, and it is something else. This will be corrected with the next build.
In the second log, the autoupdate took a few milliseconds. It was actually done before the main thread started doing something useful.
Other timings. As you can see, the most expensive for small projects is to load dependencies (mscorlib and System).
In the second log, the autoupdate took a few milliseconds. It was actually done before the main thread started doing something useful.
Other timings. As you can see, the most expensive for small projects is to load dependencies (mscorlib and System).
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
There is maybe a bug with the auto-update, because this exception does not cause the next retry to be next day, as it should
<snip>
In the second log, the autoupdate took a few milliseconds.
So I think what I should take from this is as follows:
- the second log where the auto-update is doing what it should ie skipping making a connection to the internet, gives the kind of performance that I should expect when not having PostSharp installed into the GAC or NGen'd.
- the first log shows that PostSharp is not doing what it should and is in fact trying to make an internet connection. In this scenario the compile will be slower still because of the stall waiting for the Authentication Required exception.
This will be corrected with the next build.
Cool, thats for that and keep up the excellent work
C
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
In this scenario the compile will be slower still because of the stall waiting for the Authentication Required exception.
It is not waiting. It is in a background thread. This thread is killed if the main thread terminates before the background one.
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Ok, thanks for the clarification
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
gfraiteur wrote:There is maybe a bug with the auto-update, because this exception does not cause the next retry to be next day, as it should. It is because I expect the exception to be WebException, and it is something else. This will be corrected with the next build.
Quick question, is there a fix for this in RC4 download?
Thanks
Christian
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Yes, this was fixed.
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Hi Gael,
Just downloaded the RC4 and found that the auto-update checks are still happening for each project within the solution on every build. Here's the relevant extract from our build log:
info PS0092: Unexpected error during auto-update check: The remote server returned an error: (407) Proxy Authentication Required.
FYI, the version of the PostSharp.Public dll is (1.0.10.385).
Not sure whether I'm using a version prior to your fix???
Christian
Just downloaded the RC4 and found that the auto-update checks are still happening for each project within the solution on every build. Here's the relevant extract from our build log:
info PS0092: Unexpected error during auto-update check: The remote server returned an error: (407) Proxy Authentication Required.
FYI, the version of the PostSharp.Public dll is (1.0.10.385).
Not sure whether I'm using a version prior to your fix???
Christian
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
Hm, it seems you can reopen the bug...
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Sorry to be a pain - can you tell me what the issue number is?
Ta
C
Ta
C
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
Re: Connecting to the internet causing slow build times
I did not find it. Could you create a new one?
Gael Fraiteur, project leader
- gfraiteur
- Site Admin
- Posts: 834
- Joined: Tue Dec 18, 2007 3:09 pm
- First Name: Gael
- Last Name: Fraiteur
- Company: postsharp.org
Re: Connecting to the internet causing slow build times
Issue number: 252
- christianacca
- Posts: 27
- Joined: Sat Jun 28, 2008 12:59 pm
- First Name: Christian
- Last Name: Crowhurst
20 posts • Page 1 of 1
