Marcos Vainer Loeff

Visual Studio 14 CTP3 PerfTip helping improve your custom applications performance

Blog Post created by Marcos Vainer Loeff Employee on Sep 19, 2014

 

 

After reading some interesting articles about the next version of Visual Studio, I have decided to try it and install the CTP 3 version of Visual Studio 14. If you also want to try, you can download Visual Studio 14 CTP 3 for free under this site

 

There are a lot of enhancements of the product but I want to talk specifically about one of them which I believe adds a lot of values to this community. It is called PerfTips.

 

Many of the threads in this community are related to performance. The custom applications should not only work properly but it is desirable to work as efficiently as possible. Under the vCampus Library, there are some white papers only focused on code optimization.

 

PerfTips is a new editor feature whose purpose is to eliminate the barriers between writing code and performance monitor. It displays the time execution for a method directly in the editor while stepping in through your code.

 

Let’s give a practical demonstration! If you want to know the execution time of the method PIServer.Connect() which obviously connects to the PI Data Archive, it will be displayed as soon as you pass through that line on the editor. Please refer to Figure1 which shows the screenshot of this example.

 

 

 

4503.fig1.png

 

 

 

Figure 1 - Time execution of the PIServer.Connect() method using Visual Studio 14 CTP3.

 

 

 

What about the execution time to get all values from the sinusoid PI Point form the last ten days? If we continue the program execution we will find the answer.

 

 

 

 

 

7065.fig2.png

 

Figure 2 - Time execution of the PIPoint.RecordedValues method using Visual Studio 14 CTP3.

 

 

 

You should be aware of that sometimes the first operation may take longer than subsequent calls, so the initial number returned should be taken with a grain of salt.  

 

 If you are interested in showing only the time execution which are higher than a limit, Visual Studio lets you configure it on its Options window.

 

 

 

4214.fig3.png

 

Figure 3 - PerfTips options in Visual Studio 14 CTP3.

 

 

 

Remember that you cannot install this product if you have another version of Visual Studio already installed on your machine. Microsoft recommends you to install it on new virtual machine.

 

If you want to take advantage of all of the product new features make sure to install it on Windows 8.1 and not one of its previous versions.

 

Hope you have enjoyed this tip!

 

 

Outcomes