Archive for the ‘dotTrace Tips&Tricks’ Category

dotTrace 5.0 Performance Early Access Program

Tuesday, January 24th, 2012

As some of you may have noticed, we have recently opened the EAP for dotTrace 5.0 Performance. It was a very quiet launch for a number of reasons, but now here we are talking about the new exciting version of the .NET performance profiling tool.

There’s a ton of new features in this release as outlined below and some of the major features we’ll get back to in future posts, covering them in full detail. For now, download dotTrace 5.0 Performance EAP, and read further to learn what you’re going to get with it.

Remote profiling enhancements

Remote profiling with dotTrace 5.0 PerformanceOne of dotTrace Performance benefits is the ability to preform remote profiling of applications. This comes in very useful when instance you are trying to diagnose and issue on a machine that is in production. In dotTrace 5.0 Performance, we have enhanced this behavior to allow:

  • Running the profiling agent as a regular service or ASP.NET Web Service.
  • Remote profiling over HTTP. This effectively removes some of the common barriers encountered when trying to do remote profiling such as firewalls or VPNs.
  • Less administrative permissions making it easier to use in more restricted environments.

Attach to a running process

A great new feature in dotTrace 5.0 Performance is the ability to attach the profiler to an existing process and run performance analysis on it. Once sufficient information has been collected, the profiler can then be detached. This allows us to open up new usage scenarios like taking a snapshot of an application that needs to be run for hours (or days) before it starts to display any performance issues.

dotTrace Performance can now attach to a running process

Profiling API re-design

In dotTrace 4.5.1 Performance, we introduced a very early version of the profiling API which allows you to incorporate profiling capabilities inside your application. It was a rough-cut version and had one minor glitch: you could not detach the profiler once attached. This problem has now been solved as mentioned above, and the API has been overhauled to provide a much richer development experience.

Command line support

Version 5 also introduces support for running dotTrace Performance from the command line, including:

  • A configuration helper for command line execution.
  • Ability to integrate performance profiling into the Continuous Integration process (using TeamCity for example) via MSBuild or NAnt tasks.

dotPeek integration

If you are still not familiar with dotPeek, it is a free .NET decompiler tool which we opened the EAP several months ago. One of the core ideas of dotPeek is to offer integration with our other productivity tools, such as ReSharper, whereby you can decompile any assembly for which you do not have the sources, directly from within Visual Studio. We now offer the same experience with dotTrace 5.0 Performance (we have actually posted a preview of it several months ago.) While profiling an application, if you need to dig further into the code and you do not have the PDB’s, dotTrace Performance will decompile it for you in-place and present decompiled code in the source preview area.

Decompiling .NET code within dotTrace Performance

Enhancements and additions for supported frameworks

This version will also provide support for CLR 4.5 as well as Windows 8. In addition to the new frameworks, dotTrace 5.0 Performance also provides side-by-side profiling of CLR 1/2 and CLR 4.0/4.5 frameworks.

Compatibility with TypeMock Isolator

In collaboration with our friends at TypeMock, we have made dotTrace Performance work seamlessly along with TypeMock Isolator. This allows you to easily profile your unit tests even when using TypeMock as a mocking framework. It also means that dotTrace Performance can now work in what’s called transparent mode, stepping back and allowing other engines to interleave between dotTrace and the target of the performance profile.

Improvements in Plain List View

Among the improvements is the ability to filter in-place, system functions in the Plain List View as well as group functions by assemblies:

Improved Plain List View

Other features and improvements

dotTrace 5.0 Performance is packed with a ton of smaller features, bug fixes and performance improvements, including:

  • Lower memory footprint during performance profiling.
  • Support for IIS Express from within or outside of Visual Studio.
  • Improvements on the UI for Adjust Time functionality, allowing control of non-user-defined functions.
  • Up to 20 times performance improvement on plain list construction for larger snapshots.
  • Threads with message pumping loop are now highlighted.
  • Close to 40 bug fixes, including some important ones affecting callstacks.

Get your EAP build!

You can start playing with dotTrace 5.0 Performance by downloading the latest nightly build from the Early Access Program Page today!

ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance Released

Tuesday, December 20th, 2011

Christmas is only a few days away and we’ve decided to celebrate it a little earlier by releasing not one, but all three of our main .NET tools: ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance.

ReSharper 6.1

As covered in previous posts, this release of ReSharper is much more than a few bug fixes.

Settings

In ReSharper 6.0 we laid the foundations for what would be the new settings management engine. This was quite a substantial change, both from an architectural point of view as well as functional. Unfortunately due to that pesky little annoyance called time, we did not manage to finish it for the 6.0 release. We have now though and ReSharper 6.1 introduces a wealth of new possibilities for sharing settings across solutions, teams, machines and even company-wide policies. And we’re still not done with settings, so keep your feedback coming for further releases.

image

Performance improvements

For every single release of ReSharper, we invest a large amount of time in performance improvements. This often isn’t an easy task since new releases also include new functionality. In 6.0 we had some serious performance issues with certain types of web projects. This has now thankfully been resolved in 6.1 and we’ve made 6.1 faster in many areas. Numbers are impressive: we have fixed 140 performance problems for 6.1.

Async and Visual Studio 11 support

Async support in C# is still in CTP stage. Visual Studio 11 is in early developer preview. Trying to support technology that is not entirely finished proves not only challenging but also risky. Any major changes could deem most of the work we’ve performed as obsolete. However, we know that you, our users, play with the early bits and miss ReSharper.

image

That’s why in 6.1 we provide support for Async features in C# and VB.NET, as well as initial experimental support for Visual Studio 11. Support for Metro style applications is not yet included, and in order to install ReSharper into VS11 Developer Preview, you have to use a separate .vsix installer available at ReSharper downloads.

Optimizing assembly references

Many users rely on ReSharper in streamlining their project maintenance tasks, and this new feature is a nice addition to the existing project-level toolset. In any project in your solution, ReSharper 6.1 detects assembly references that are not effectively used, and helps remove some or all of them.

image

SDK

During 6.0 development we invested heavily in trying to provide a better API for extending ReSharper. 6.1 also sees the birth of this effort. Along with an improved API, we also now provide a testing framework, Visual Studio templates for creating plug-ins, samples, as well as online documentation. ReSharper 6.1 SDK is available for download as a .msi or .zip package.

image

More awesome features

Here are a few more great features also added:

  • Structural Search and Replace for HTML and ASP.NET. You can now use Custom Patterns to refactor both HTML and ASP.NET markup.
  • Call tracking for ASP.NET MVC. Same call tracking features, extended to ASP.NET MVC 3.
  • New code inspections. Access to disposed closures, covariant array conversions and more.

We have also fixed many outstanding issues. Look for more blog posts describing 6.1 features and improvements in future here on the JetBrains .NET tools blog.

dotCover 1.2 and dotTrace 4.5.2 Performance

These are mainly maintenance releases with a primary focus of supporting ReSharper 6.1. In addition, dotCover 1.2 works side-by-side with TypeMock 6.2.x, provides performance improvements in report generation, reduces HTML report size and memory consumption.

Note that we are already working on next major dotCover and dotTrace Performance releases. EAPs are expected soon, exposing a ton of new functionality and improvements, so stay tuned for that.

Download them all!

You can download ReSharper 6.1, dotCover 1.2 and dotTrace 4.5.2 Performance right now!

Last but not least, we’d like to wish everyone very Happy Holiday season. Stay safe and see you all in the New Year!

dotTrace: Profiling decompiled code

Wednesday, August 17th, 2011

As you might know, dotPeek is our Free Decompiler which is currently available under the EAP program. The core engine for dotPeek is also included in ReSharper 6, allowing us to navigate and analyze assemblies for which we do not have the source code.

As could be expected, we will be including the same feature in dotTrace Performance. This potentially allows us to decompile any code we are profiling and examine if a potential issue could lie in this actual decompiled code.

Take the following sample application (in this case Nerddinner) :

image

When examining the list of functions, we might encounter a call that is part of a library. When trying to display the source, dotTrace would prompt us for the PDB files.

image

If, for whatever reason we do not have the PDB files, we can now click on the “Decompiled source” tab and have the dotPeek engine decompile the source code for us:

image

This makes it even easier to dig into third-party code to determine if there are any potential bottlenecks. This functionality will be available in the next major version of dotTrace and available soon when the EAP program opens.

dotCover 1.1.1 and dotTrace Performance 4.5.1 Released

Thursday, August 4th, 2011

dotCover 1.1.1 and dotTrace Performance 4.5.1 have been released!

dotCover 1.1.1

Despite the minor revision number, dotCover 1.1.1 introduces a ton of new features in the release.

ReSharper 6 Integration

With the recent release of ReSharper 6, we’ve been working hard to provide support for dotCover. As in previous versions, you can now run code coverage of tests directly from Visual Studio via the ReSharper test runner:

SNAGHTML1a469e3b

In addition, if you’re using ReSharper 6, you now get an additional icon (image) which allows you to cover all tests from the solution easily (accessible via the shortcut key Ctrl+U, K). Of course, ReSharper 5.x is also supported with this release.

Support for Dynamic NUnit Tests

dotCover now fully supports what are classified as dynamic tests in NUnit, i.e. those with variable input parameters and thus generated when tests are run. This includes the common TestCase attribute as well as Combinatorial, Sequential, TestCaseSource, Pairwise, Repeat as well as Random and Range attributes supported in method parameters.

image

image

This of course also allows a correct interpretation of tests covered by a certain section of code:

image

which corresponds to placing the cursor on the return statement and asking dotCover to Show covering tests (Ctrl+Alt+K). If we were to place the code on the exception we’d get:

image

as expected.

Exclusion/Inclusion Nodes Persistence

In dotCover 1.1 we added the possibility of excluding or including specific tests from coverage by selecting the node in the tree. We now provide persistence of these nodes between coverage runs (saved in *.settings file when saving snapshots), as well as support for Undo and Redo operations via the normal Ctrl+Z/Ctrl+Y key shortcuts.

image

Other Improvements

Apart from the previous, this release also includes

  • Optimizations in the area of snapshot storage, memory consumption and performance of multi-threaded applications.
  • Per-Snapshot settings, allowing snapshots to be saved along with node persistence exclusions as indicated previously (saved as *.dcvr and *.settings respectively).
  • Improved notifications during coverage analysis
  • Embedded progress bar in Unit Test Session Runner, as opposed to a modal dialogue
  • Warnings when no coverage for a selected test is found

Download from here

dotTrace Performance 4.5.1

This release of dotTrace has primarily been focused on integration with ReSharper 6 and minor bug fixes and improvements. Much like dotCover, dotTrace also supports the possibility of profiling all tests with one button click (image)  or using the shortcut key Ctrl+U, O. This feature is in fact available for any custom test host provider that use ReSharper’s test runner.

image

Other Improvements

This release also includes:

  • Shortcut provided (Ctrl+R) for editing configuration used for profiling without having to first return to Welcome screen.
  • Fix for OutOfMemory exception when constructing Hotspot Views
  • Support for Opening all method instances merged (Ctrl+Shift+T) in Hotspots View
  • Support for Adjust Time on special functions like Garbage Collector or Native Code
  • Fix for Registry Cleanup allowing Windows services to work as intended
  • Improved stability under IIS and ASP.NET
  • Fix of the computation of the total time of Children nodes for a root constructed as implicit recursive node
  • Work started on Profiling API

and more bug fixes.
Download from here

Simulating Performance Improvements with dotTrace

Thursday, March 10th, 2011

Let’s say you’re trying to improve performance of some application that is doing poorly. You manage to find what could potentially be a bottleneck and decide that it needs fixing. Of course, Murphy’s Law dictates that the potential issue you’ve found is probably one of the harder problems to solve as it might involve improving a calculation algorithm or changing some third party framework.

This could turn into quite an expensive operation. It would be a shame to spend time and resources on it to not have a the desired impact on the overall system. In other words, it’s best to know you’re barking up the right tree.

What if…

That’s where dotTrace Adjust Time feature comes in very handy. By allowing us to adjust the amount of time spent in a particular spot of an application, we can simulate the overall impact it would if we were to perform optimizations in that area, without having to actually do them first.

Let’s take a look at the following call tree of a performance trace for a sample application

Looking at the call trace, we can see that the majority of the time spent is dedicated to IntersectRay. This method in turn calls Sphere.Intersect and Plane.Intersect. Out of the two, the first is the more time-consuming

What would happen if we were to now try and optimize the performance of Sphere.Intersect? What overall impact would it have if the time it takes to complete the call were reduced by 30%.

Now, instead of spending time on re-designing the method, we will use the simulation functionality in dotTrace to verify whether it’s worth a potential effort.

To simulate the improvement, we right-click on the Intersect line and select Adjust Time

We are then prompted by a dialog box that allows us to adjust the time by a factor of 0 to 100.

Apart from adjusting the time, we can indicate whether we want the adjustment to be only on the specified call stack that we are currently on (Selected Call Stack), applied it to all call stacks (All call stacks) of this method or call stacks with the calling method as the parent function (this last option is available in dotTrace 4.5 EAP only).

We can also specify whether we want the adjustment to effect the overall time of the function (the function itself and all functions it calls), only the function’s own time or all functions of the the specified class.

It is important when applying adjustments to take these options into account because selecting different values can have an impact not only on the current call stack we are trying to optimize but also on the entire application.

In our case, we are going to apply adjustments to all call stacks and to the function’s total time. We will apply a 30% reduction, which means we will enter 70 as the Factor value. This now produces the following result

First thing to notice is that the line where we’ve adjusted the time is crossed out. Next to each time, we now see a new amount in the color green and the original time in blue in brackets. Focusing on the IntersectRay method, a 30% improvement of Sphere.Intersect would lead to approximately 19% improvement on the call and an overall increase of 15% in terms of performance. Is that worth it?

Let’s dig deeper. Opening up Sphere.Intersect we see that 24% of the time is dedicated to the Vector.op_Multiply. What would happen if we were to focus our improvement exclusively on this method call? Applying the same 30% increase in performance, we’d end up with an overall increase of 14%

Despite representing only 1/3 of the total time of Sphere.Intersect, an improvement on that call alone will provide us with the same overall performance increase as concentrating on the complete method. In fact, it makes more sense to optimize the op_Multiply method since it’s used extensively throughout the application. That’s where we should focus our efforts!

Optimization Shortcuts in 4.5

dotTrace 4.5, which at the time of publishing this post is in EAP, introduces some shortcuts for time adjustment. When right-clicking on Adjust Time context menu, a submenu displays two additional options:

which allow us to quickly optimize the current (or all) instances of a specific method. Optimizing means setting the total time to 0.

Experimenting before committing

The reason for the Adjust Time feature in dotTrace is for experimenting with different calls before actually having to commit to changes. Often a 10% increase in one function can lead to a 20% overall improvement. Other times, it can lead to a 2% improvement. Knowing this before hand is very valuable since it provides us with something to balance against to see not only whether we’re barking up the wrong tree, but also if it’s worth barking at all.

Tales from QA: The “Re-Design” of the Dialog Box

Tuesday, February 1st, 2011

0_53699_50f6409b_orig

by @Asia_Rudenko

Sample SSR Pattern Catalog Available for Download

Wednesday, June 2nd, 2010

A while ago we introduced Structural Search and Replace, a new powerful feature in ReSharper 5 that lets you search for custom code patterns and replace them with other patterns, facilitating batch removal (or improvement) of stinky code.

We were hoping to include a set of ready-to-use search and replace patterns into ReSharper 5.0 release but it just didn’t happen. Instead, we’re publishing a sample Pattern Catalog on the web site for you to download.

The sample Pattern Catalog currently contains 17 patterns to search for and replace unreachable code, redundant compound assignments, clumsy method chains, and other pieces of code that you’d better get rid of.

As soon as you’ve downloaded and unzipped the Pattern Catalog, do the following to import it:

  1. In Visual Studio, choose ReSharper | Tools | Pattern Catalog.
  2. Click Import and select the XML file that contains the sample Pattern Catalog.

ReShaper 5.1 Early Access Program is Open

Thursday, May 20th, 2010

A couple of weeks ago we posted a blog entry on known issues in ReSharper 5.0 and workarounds, and today we’re taking the next logical step by opening a new Early Access Program for ReSharper 5.1 to fix them. If you’ve having issues with ReSharper 5.0, please start downloading ReSharper 5.1 nightly builds: it should feel much better.

Here’s a quick list of fixes that the Early Access Program presumably brings:

  • Typing latency in ASP.NET Web Forms and MVC is considerably reduced.
  • Code-behind files in ASP.NET projects don’t disappear when saving files anymore.
  • Splitting Visual Studio text editor tabs does not result in ReSharper features disappearing from one or both tabs.
  • Silverlight 4 support is fixed: no more error highlighting when referencing Silverlight 4 code from a regular .NET assembly.
  • Encoding issues when working with XAML files are resolved.

If something goes wrong, please report issues to our YouTrack project.

dotTrace 4.0 Puts On a Fine Performance

Thursday, March 18th, 2010


Front seats at the ballet: $200

Front seats at the ball game: $100

Quickly spotting bottlenecks in your .NET application: priceless

There are some performances money can buy. For everything else, there’s dotTrace 4.0 Performance.


Jokes aside, here’s what dotTrace 4.0 Performance, currently in Beta, brings to the table.

Support for:

  • Visual Studio 2005, 2008, and 2010
  • .NET Compact Framework 3.5
  • .NET Framework 1.0 to 4.0
  • Silverlight 4

New profiling modes:

  • Remote profiling: connect to a remote machine to profile a standalone or web application, or a Windows service.
  • Line-by-line profiling: view detailed timing information for every statement in methods that have source code available.

What-if scenarios:

  • Ever thought, “What if I optimize this function by 40%?”? Now dotTrace knows the answer! It can recalculate a snapshot without reprofiling your application, so you can instantly estimate potential performance gains.

New edition scheme:

  • dotTrace 4.0 Performance comes in two editions: Standard and Professional. Standard Edition provides all the functionality that is available in Professional Edition, excluding support for .NET Compact Framework 3.5, Silverlight 4, and remote profiling.

Other goodies:

  • Improved speed and accuracy in all modes, plus a ‘high accuracy’ flag to take into account the time spent inside the profiler.
  • Extremely robust handling of huge snapshots (up to hundreds of GB!)
  • Snapshot annotations:

Read more at What’s New.

Download a free 30-day trial of dotTrace 4.0 Performance Beta today.

More questions? Check out the updated dotTrace FAQ.

Tales from the Development Crypt: Snapshooting 450GB

Wednesday, April 15th, 2009

We have recently crossed the bounds of our specialization to set a world record in data transfer rate by throwing a 450GB file from one machine to another in only 1 minute! It was surprisingly easy: all we had to do was find a fast-running developer and equip the guy with an HDD!
Fake world records aside, only 4 months since our previous milestone, we’ve collected and successfully opened a 450GB snapshot. We mean it. Anyone ever seen a .NET profiler lifting that much weight?