CodeRush for Roslyn (CRR) is a new product from DevExpress, distinct from its predecessor CodeRush Classic. Its main difference is the use of Microsoft’s compiler platform, Roslyn. CCR isn’t offering all the features of its predecessor yet; they are being added as new versions are released.
Roslyn, with its new APIs in Visual Studio 2015, makes it possible to build code aware libraries such as CodeRush without requiring a custom compiler. The main issue with that choice is that it means a major refactoring effort for an already mature product; all existing features need to be rewritten in order to use Roslyn.
On the other hand, the benefits of doing so are not to be neglected. Visual Studio extensions using Roslyn can use Visual Studio’s already generated abstract syntax tree, saving it from parsing the solution a second time. It also removes the need of keeping similar parsing artefacts twice in memory. Major performance gains on solution opening time and memory usage can be achieved, as shown in the benchmarks. Vendor benchmarks need to be taken with a grain of salt, but the results look nonetheless promising.
Three open sources projects were benchmarked: DotNetOpenAuth, Orchard and Roslyn. The memory consumption is:
- Small solution, DotNetOpenAuth, CodeRush uses 6MB.
- Medium-sized solution, Orchard, CodeRush uses 13MB.
- Large solution, opening the source code to Roslyn itself, CodeRush uses 55MB.
The solution open times are, in order for DotNotOpenAuth, Orchard and Roslyn, increased by 0.5, 2 and 1.5 seconds, compared to Visual Studio load times of 6.5, 9 and 13 seconds.
For a new CodeRush user, there is now the question of which product to install. Mark Miller, chief scientist at DevExpress, writes:
If you’re working in Visual Studio 2015 with the new language features in C# or VB, you should install CodeRush for Roslyn. If you rely on CodeRush Classic features that haven’t been ported yet, you’ll need CodeRush Classic. If you need both, you can install and use both (more on this in later posts).
Maintaining two products doing basically the same work is expensive and the deprecation of the Classic version is to be expected, as Mark Miller continues:
At some point in the future, when we have ported the entire CodeRush Classic feature set to CRR, we intend to deprecate CodeRush Classic. We will continue to support and fix issues in CodeRush Classic for some time beyond this deprecation point, however CodeRush Classic is unlikely to ever get support for new language features (e.g., C# 6, VB 14, and beyond).
CodeRush for Roslyn is expected to “reach essentially feature parity with CodeRush Classic by the end of this year”. Updates should be released every four weeks until the release of the final version.