Archive

Last week we announced that PostSharp 2.1 CTP was available under our Early Access Program (EAP, in short). So what is the SharpCrafters EAP? It’s very simple:

  • Free and open to everyone. You register by selecting the right option in your user profile.
  • Get access to pre-releases. One you registered, CTPs and hot fixes will be unlocked.
  • Get notifications to your mailbox every time an important bug has been fixed. We do not send commercial emails, just technical ones.
  • Unsubscribe at any time. If you don’t want to participate in our EAP, you can unregister at any time by editing your profile.

So why are we offering this EAP? It’s also simple: because we need your help. Although we test every change carefully and have lots of regression tests, we just can’t think of every possible combination. Development environments have very different configurations, and compiler sometimes emit non-standard assemblies or debugging symbols. Most of the time, when we can think of a situation, we have a test for it. Most bugs come from situations we did not imagine. So we need your help to test PostSharp with the largest set of scenarios possible.

Our way to say Thanks!

Since we appreciate the time you spend testing our software and reporting issues, we will offer one free license of PostSharp Professional Edition for every bug you report and reproduce. You qualify if:

  • You help us reproduce the issue, i.e. you typically provide material (source code or DLL) that let us reproduce and fix the bug.
  • You are the first to report and reproduce the bug.
  • We acknowledge it as a bug of reasonable importance (not as a ‘feature’ or a minor defect without impact, for instance).
  • You have to claim the free license by email. Don’t assume we remember everything :).

If you report more than one bug, you will receive several free licenses for you to give away (not for resale).

We need your help. To get started, download PostSharp 2.1 CTP and report issues in the support forum.

Happy PostSharping!

-gael

I’m pleased to announce that the first Community Technical Preview of PostSharp 2.1 is available for download.  Note that you have to register to the Early Access Program before you can access download. Registration to the EAP is free for anybody.

As any CTP, this release is meant for testing and not for production use.

PostSharp 2.1 is a minor upgrade to PostSharp 2.0, which means that your existing license key should just work.

What’s New in PostSharp 2.1 CTP 1?

This first CTP is all about improving build-time performance, i.e. making PostSharp compile faster.

Much faster.

Here are the results measured by Bartek Legiędź and Remigiusz Cieślak, software engineers at Comarch in Poland. Their setup consists of a small number of very large projects (assemblies of several megabytes). As you can see, PostSharp 2.1 is more than five times faster than 2.0.

The next table compares the time taken by PostSharp while building the solution in two configurations (debug and release). Of course PostSharp itself ran in release mode both times.

Build Configuration2.0 2.1 Speedup
Debug Configuration 160,662 ms 21,293 ms 672%
Release Configuration 121,694 ms 23,897ms 571%

Thanks guys for your time doing this benchmark!

The performance improvement you will experience with your setup depends on several factors: size and number of projects, number of aspects, and hardware resources. Also, remember that PostSharp is only a part of the build process. After upgrading to PostSharp 2.1, the build time may be dominated by the C# compiler or by Code Contracts.

I would like to hear about your own experience of performance improvements.

Here is how to produce benchmark results:

  1. Wait until the system load is stably low (TortoiseSVNCache.exe and similar processes may load your processor)
  2. Execute: Msbuild /p:Configuration=Debug /clp:PerformanceSummary /t:rebuild > msbuild-2.0.log
  3. Upgrade your project to PostSharp 2.1 (see below)
  4. Execute: Msbuild /p:Configuration=Debug /clp:PerformanceSummary /t:rebuild > msbuild-2.1.log

The performance report lays near to the end of the log file, above the summary of warnings and errors. For greater accuracy, you should execute MSBuild three times with every version of PostSharp, and take the best results. Then you can send me both performance summaries by email (gael@sharpcrafters.com) so I can see how large are improvements with real-life projects. Frankly, I don’t expect 500% improvement for everybody.

What Changed in PostSharp 2.1 CTP

Most performance improvements were obtained by replacing the component that writes back the assembly to disk. Before version 2.1, PostSharp still used  our ol’ good text-based writer, backed by Microsoft’s ILASM. This required a lot of I/O just to create the text IL file (some customers reported files of several hundreds of megabytes), then ILASM required a lot of CPU and memory to process it. Fortunately, this was not that bad and there were excellent reasons to keep this writer. Now we have our own assembly writer, coded by your servant himself, and tuned with all the obsession and passion he is able of.

You should normally not observe any difference from PostSharp 2.0, except of compilation speed. Debugging support may be a little improved because I integrated some bits of the Microsoft CCI PDB reader/writer into PostSharp, but this debugging support is still to be fine-tuned.

So except this, there’s no change in this CTP, no addition of feature.

Redefinition of the Community Edition

The Community Edition is being renamed Starter Edition, because the former name did confuse many people.

We’re doing two little changes in the features available to the Starter Edition:

  • The Aspect Dependency Framework (PostSharp.Aspects.Dependencies) will not be available any more in the Starter Edition. Frankly, this feature was present by mistake, since it clearly supports “pro” scenarios. To order aspects, Starter users will have to use the AspectPriority attributes, i.e. they will have to assign an integer to every aspect.
  • The Starter Edition will not run from source control. It will have to be installed on the computer.
  • Yes, the new build-time performance enhancements are available to the Starter Edition!

So we add a lot and we remove a little in order to position the Starter Edition as a light tool for individuals, and the Professional Edition as – well -- a professional tool for teams. We do not push anyone in the corner. You all have workarounds: installing the product or using AspectPriority. We are just getting clearer about the positioning of each edition. We think we’re adding more comfort to the Starter Edition than we actually remove.

And remember: PostSharp is cheap (usually less than one day of bill), and we give a lot of discounts to students, Microsoft BizSparks members, or influencers.

Upgrade to PostSharp 2.1 CTP

PostSharp 2.1 CTP can be installed side-by-side with PostSharp 2.0 on the same machine. At build time, the correct version of PostSharp should kick in, according to the version of PostSharp.dll your project is referencing.

There is one exception to this rule. The Visual Studio Extensions (VSX) cannot be installed side-by-side, so the setup program of PostSharp 2.1 will remove the VSX of PostSharp 2.0 and replace it by the new version. Since it’s backward compatible, the VSX 2.1 will work with projects using PostSharp 2.0.

Once you’ve installed PostSharp 2.1 (or copied it to your source control), you can run the PostSharp 2.1 Conversion Utility (PostSharp.Convert.exe), a simple application that let you update your references from previous versions to the current one. The utility is also able to prepare your project to run PostSharp from source control, if you prefer not to install it using the setup program. Note that all this utility does is to edit your csproj or vbproj files.

Gotcha: When a project references both PostSharp 2.0 and 2.1

What happens if you have a project that has been migrated to PostSharp 2.1, but uses a component (such as Gibraltar aspects) that has not been? The project would have a direct reference to PostSharp.dll version 2.1, and an indirect reference to PostSharp.dll version 2.0.

  1. Make sure that the old PostSharp.dll dependency is not copied to your final bin directory. At run-time, you will need the version 2.1.
  2. Install the last hot fix of PostSharp 2.0.
  3. Add the following code to your application configuration file:
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="PostSharp" publicKeyToken="b13fd38b8f9c99d7" 
culture="neutral" /> <bindingRedirect oldVersion="2.0.0.0" newVersion="2.1.0.0" /> </dependentAssembly> </assemblyBinding> </runtime> </configuration>

Therefore, our partners don’t need to recompile their product for every of our minor version, and you can always use the version of PostSharp you would like.

What’s Next?

We did our best to address the major painful point reported by users: building time. We tested the new PE writer on large and complex assemblies like those forming the .NET framework itself. Now we want to hear from you:

  • Does it work for your projects?
  • What are the performance gains?

In the mean time, we’ll be working on the next CTP, which should bring some minor new features. Then there’ll be the cycle of RC and finally the winner RC will be promoted RTM.

Happy PostSharping!

-gael

ATTENTION LONDON .NET COMMUNITY:
We’ll be in town next Thursday, December 2nd, for a full-day of PostSharp Training.

Here’s the agenda:

10:00 - 10:45 An introduction to PostSharp and Aspect-Oriented Programming
11:00 - 11:15 PostSharp customer presentation
11:15 - 12:00 Hands-on: developing simple aspects and applying them to code; understanding aspect lifetime; troubleshooting

Lunch!
13:00 - 14:15 Deep dive into aspect types, code generation, and other advanced features
14:30 - 15:45 Hands-on: developing complex aspects with advice and pointcuts; solving/preventing conflicts between multiple aspects on the same piece of code
16:00 - 17:15 What’s new in PostSharp 2.0; Comparison to other AOP frameworks; Licensing and pricing
17:30 - 18:00 Workshop: the value of aspect-oriented programming and what we can do to make it popular in .Net.

Here’s the best part—it’s free!

If you’re in the London area, and would like to learn more about how PostSharp helps teams produce cleaner code, please contact me via email (britt@sharpcrafters.com) and I'll add you to the attendee list plus send you the location details.

-Britt