Performance Profiling in Visual Studio : VSTS Profiler

What is Performance Profiling? ­Performance profiling is defined as analysing the space and time

What is Performance Profiling?

­Performance profiling is defined as analysing the space and time complexity of any program in terms of software Engineering. In simple words, it helps improve performance of any program or software. Usually performance is based on two major factors, Time of execution and memory management. Microsoft has created Performance Profiler (VSTS Profile) build in Visual studio as a part of Visual Studio Team System(VSTS) and is capable of profiling every project created within Visual studio by custom software development companies.

Analysing the performance

In order to completely understand the concept of Performance profiling, we are going to create a Sample MVC application, then we can see how we can diagnose the overall performance of the website. The tool available in Visual Studio is Performance Wizard which generates a report, covering all the ways necessary for profiling by software development companies. These are as follows:

  • CPU Sampling
  • Instrumentation
  • .NET Memory allocation
  • Resource Contention

Let’s start by creating a sample application and check about the performance analyser, step by step

 

Step 1:  Create a simple MVC Project in Visual Studio and build the project without doing any changes.

 

Step 2:  Change the Configuration Mode from Debug to Release

 

Step 3:  Go to Menu Analyze -> Performance Profiler

After selecting the menu, you will see the tools available for Analysing, select the Startup Project, check the Performance Wizard tool and finally click on Start button

 

Step 4:  A Performance Wizard window will appear as below, In this steps, there are 4 different ways for profiling and each one has different purpose, for now, remained selected CPU Sampling and click on Next > button

In the next window, you will see all the available Projects we have present in the solution, in our case it will be SampleMVCWebsite, the other option are An executable (.EXE file) and An ASP.NET application, as we want to profile for the complete project we keep our project selected and click on Next >

In next step, the Wizard will tell you that the performance session and profile will be shown either in IIS or development server, it is just an info window and we click on Next >

You have arrived to the final step of wizard, it is mentioned here that you have completed all the settings and that’s all, we finish the wizard by click on Finish button.

 

Step 5:  At this point the profiling has already begun, you can notice that the development server has already initialized, your browser has already loaded the website and profiling is on. You would notice below image in visual studio with an output window providing each step of the profiling. You can pause or stop the profiling during any time of the process.

 

Step 6:  Go to browser where the website is loaded and browse /Account/Register of your website by clicking on register link on the top. Fill the form and complete all the validation necessary for the password strength and click on Register button.

Now, go to your profile in the website and you will see the following details on the screen, you can change your password here and Manage external logins.

Try changing password, after password is successfully changed, log off and close the browser window.

 

Step 7:  Go back to the Visual studio as soon as you close your browser. You notice that the report is starting to generate as image below. You can see the steps in the output window as it is collecting all the data required for generating report file (.vspx). It takes a few seconds to process all the records and display all the result in a window.

 

Step 8:  This is the step where you see the result of the process you have done in the browser, that is, Register, password change and log off. There is a graph which shows the CPU usage in Y axis and time taken for execution (in seconds) in X axis. During the whole process, you can analyse which part of the code is consuming how much CPU usage.

You can see the CPU usage in depth, like the process where we have registered in the website, to do so you have to select the area in the graph and click on the “Filter by selection” link, just right side of the graph.

After filter selection, you can see the details of the area where we have clicked on the register process as below. The time between 23 seconds and 30 seconds is the time where the registration process is completed. We can analyse that the whole registration process took roughly about 4 seconds. You can see also the methods calls during this process below the graph and there Sample usage percentage during the registration and below that you can see the Individual functions performance

For Individual function performance, you can click on the selected “MoveNext” as below,

You have now reached the Function Details windows as below, here you can see the “Calling functions” à “Current Functions” à “Called functions” and below that the code which has executed during this process.

Calling function refers to the method from where the Registration part is started.

Current function refers to method body where all the registration process is happening.

Called functions refers to all other method which are going to be called in the Current function.

You can click on the each method in the Called functions to see the details of that function and checkout the processes within that functions and so on until you reach end of the stack. Move forward or backward during whole process and their implementation and sampling all are reported within that section. You can even see the code section which is consuming all the CPU processes.

There are other windows available to see more in depth which you can see in the top dropdown box along with other options like filtering saving the report and export the report for future use.

And finally save the report to be used in next step. Reports are saved in Reports folder or you can view it in Performance Explorer.

 

Step 9:  All the Sampling data helps us determine the total performance of an application. After collecting data, you can easily optimize your code and re run all the steps necessary for profiling, review it, generate the report and save it in the same folder “Reports” where you have saved the previous sampling report. Select both old and new sample report and right click the selection and then Compare Performance Reports. After that, the comparison window shows the differences, performance regressions, and improvements that occurred from previous profiling to the new.

Summary

The Performance Profiling in Visual Studio is great tool for c# software development companies which helps to improve the project performance in day to day life activities and provides the best methods to analyse the problem. The most profitable thing is, everything is in Visual studio where code is written and analysed for performance issues. This tool provides the details of how and where to improve the performance in any application. Please note, the more profiling you do, the more improvement in application performance one sees.

E-commerce solution analysis – NopCommerce vs Kentico

What is NopCommerce? The NopCommerce is an open-source e-Commerce platform for designing and develop

What is NopCommerce?

 

The NopCommerce is an open-source e-Commerce platform for designing and developing eCommerce websites for various kind of online businesses. NopCommerce is shopping cart tool which is easy to use both for merchants as well as consumers. NopCommerce uses Asp.Net as front-end tool and MS SQL as back-end tool. Since it is an open source, it can easily be downloaded for free. (Wikipedia, 2016) states that as on December 2015, approx. 25,511 websites used nopCommerce. E-commerce solution providers in India prefer NopCommerce for many online stores for diversified industries.

What is Kentico?

Kentico is Web Content Management System (WCMS) software mainly used to build websites, online stores, E – Commerce website, etc. It delivers consistency across multiple channels and devices. For E– Commerce solutions, it has simple integration with external systems and easy to deal for consumers. It also supports multiple currencies as well as languages so we can say it is global online retail store. It also provides online-marketing system that helps in personified customer experience. It is also used for online communities. It has extensive sets of features as well as functionalities for any website development. Kentico is all-in-one platform built, so it is platform independent. It provides solution on platforms like Microsoft ASP.NET, on-premise or in cloud.

Here, we are comparing NopCommerce vs. Kentico

 
Brief NopCommerce is tool from which one can develop fully featured E-commerce website with attractive UI. Kentico is marketing solution that provides functionality for building websites, online stores, E-commerce solutions, mobile websites, SEO, etc.
Holding company Author: Andrei Mazulnitsyn The nopCommerce development team. Kentico Software
Framework Supports Microsoft .NET Framework 4.5.1 or above Supports Microsoft ASP.NET or CloudFramework 4.5.1 or above
Features Mobile commerce
Multi-store
Multi-vendor
Product features
SEO
Dynamic NC Site Search
Single Dashboard Control
Flexible .Net Architecture

Availability of exchange rate system based on the real time prices and multicurrency support which helps buyers the globe to shop freely irrespective of current location) And others as mentioned on their website.

Kentico’s built-in WYSIWYG editor provides formatting features.

Multilingual Content (includes English, Chinese, Russian, Spanish, Hebrew, Arabic, or Eastern European languages, etc).

Media library Certified Extensions and many more. And others as mentioned on their website.

 

 

Type Online Store CMS, WCMS, E–Commerce, online marketing platform.
Supported databases MS SQL Server 2008 or above & MS SQL Server Compact 4.0 or above Microsoft SQL Server 2008 R2, 2012, 2014 (including the free SQL Server Express Edition 2008 R2/2012/2014)
Programming Language C# C#
Supported browsers Microsoft Internet Explorer 8 & above (IE6 & IE7 were supported in versions prior 3.60) Mozilla Firefox 2.0 & above Google Chrome 1.x Apple Safari 2.x Chrome 15+
Microsoft Edge
IE 9+
Firefox 8+
Opera 11.6+
Safari 5.0.6+ on MacOS
Open Source Yes The full source code is available. only to limited number of paying companies to avoid flaw by hacker.
Price Free Paid versions are available depends on features.
Usage Ref - (Builtwith, 2016) 30,176 websites 43,177 websites
Benefits

SEO Friendly
Customizable and Flexible Stable and highly usable Multiple Device Support

 

Quick and easy page management
Layered architecture
Secure architecture
Mobile – Site or Mobile Friendly Security Extensibility and Scalability Flexibility for developing own features.
Disadvantages Limited extension for additional features available. Less performance for high data driven websites. Small community As it has paid versions there are limitations for Free and Trail versions. Does not provide 3rd Party Components. Small range of its community.
Support Online forum Offers 24/7 Support from multiple location worldwide. Also have 7-day bug fix policy
Popular sites

Ref - (WAPPALYZER, 2016) :

catchyprice.com
te.mediabelgium.be
cellarlink.com.au
outfitters.com.pk
lenscim.com
jishec.mynet.net
hejdes.woody.se
fungho.com
b2b2c.weingenious.com
barista.gr

Ref - (W3Techs, 2016)

Skype.com
Prensalibre.com
Newsmax.com
Mercola.com
Confirmit.com
Licindia.in
Pearsonvue.com
Fxopen.com
Fxopen.com.au
Fxopen.co.uk

Marketshare Ref - (W3Techs, 2016) 0.1% of all the websites whose content management system W3Techs knows. This is 0.1% of all websites. 0.2% of all the websites whose content management system W3Techs knows. This is 0.1% of all websites.
Awards and recognitions As per (Microsoft, 2016), nopCommerce is in top 5 most downloaded application by Microsoft Web Platform Installer Per (Gotech, 2016), nopcommerce is chosen as the best finance app by Russian WebReady Awards As per People Choice CMS Award, In 2016, nopCommerce won CMScritic's "Best eCommerce for SMB" award. (Kentico, 2016), October 2016, Kentico named in the Gartner Magic Quadrant for Horizontal Portals September 2016, Kentico named a Challenger in the Gartner Magic Quadrant for WCM 2016 January, Kentico reaches 200 employees

Conclusion:

Thus, we can conclude that if E-Commerce solution providers in India are looking for small or medium size E-commerce portal then NopCommerce is the best framework as it is free and open source. Kentico is for business, someone who wants proper website, not just a few static pages and also for whom security is main reason.

Bibliography

Builtwith. (2016, 12 23). nopCommerce Usage Statistics. Retrieved from Builtwith: https://trends.builtwith.com/shop/nopCommerce

Gotech. (2016, 12 23). Gotech. Retrieved from Gotech: http://www.gotech.vc/

Kentico. (2016, 12 23). Kentico History. Retrieved from Kentico: http://www.kentico.com/company/history

Microsoft. (2016, 12 23). Microsoft. Retrieved from Microsoft: https://webgallery.microsoft.com/gallery

W3Techs. (2016, 12 23). W3Techs. Retrieved from W3Techs: https://w3techs.com/technologies/details/cm-kentico/all/all

WAPPALYZER. (2016, 12 23). WAPPALYZER. Retrieved from WAPPALYZER: https://wappalyzer.com/applications/nopcommerce

Wikipedia. (2016, December 23). NopCommerce - Wikipedia. Retrieved from NopCommerce - Wikipedia: https://en.wikipedia.org/wiki/NopCommerce

 

 

Visual Studio 2017 – New features and updates

Introduction Visual Studio is a very giant integrated developing environment for all the Microsoft t

Introduction

Visual Studio is a very giant integrated developing environment for all the Microsoft technologies from desktop apps to websites to mobile apps to gaming. Written in c++ and c#, it provides a developer and asp.net software companies to enhance the productivity with many advanced features like intellisense support for all the integrated languages, the debugger which can debug on machine level and source level, tools and controls for creating User Interface and many more.

The Latest version is Visual Studio 2017 RC, it has many new features and upgrades from the previous version, startup time and load time of the projects is very less compared to previous version and has the preview version of the Microsoft’s new cross platform .NET Core and Docker. All the new features are included in the next section.

New Features and Updates

  • Offline Installation:

    Visual studio 2017 now supports offline installation which doesn’t require internet during installation process. The offline executable can be created by the system administrator with a simple command “vs_enterprise.exe --layout c:\mydownloadfolder”,it will download all required packages in c:\mydownloadfolder for the offline installation. After downloading, you can easily install by running the executable present in the folder “mydownloadfolder”.

  • EditorConfig:
    Support for EditorConfig is now included in 2017 version, this will allow a developer and c# software development companies to create their own user defined setting for better coding style in a project and will be available to all the developers working on a particular project. All the project will have this file with extension .editorconfig
  • Connected Services:

    This feature is the updated version of "Add Connected Service" or "Add Service Reference". A new node in the solution explorer with a new icon will be shown in the solution explorer, you can view all the available service from Microsoft to connect to through this feature.

  • Folder View:

    This feature in particular has improved drastically which takes 50% load time as compared to the previous version of VS. Also new icons and folder views are included like for Connected Services. Overall the project loading is fast and improved.

  • Go To:

    In this version the Go To feature is improved a lot, like It will let you quickly find files, classes, Methods and other reference objects, the search will show the list of all the objects from different files just while you are typing. Go to line will now show you the total number of line present in the document of which where you want to navigate. “Navigate To” option is now included in Go To feature.

  • IntelliSense:

    Intellisense is now more advanced and filters the result and gives you options according to the language you are writing on. Dot-To-Arrow feature is now advanced along with other features like Expand Scopes and Expand Precedence. New mode are added in the filter area of the Intellisense.

  • Debugging enhancement:

    The very first point which is “Run to Click”, it will save lots of developers and vb.net software development companies time to put a temporary breakpoint while debugging the code. Just click on the icon before the line where you want to debug and it can be disabled from the debug options. Another important feature is Chrome debugging which is very important for the Web developers which lets you debug the JavaScript code from VS running in the Chrome.

  • IDE Experience and Productivity:

    As per the release notes of the Visual studio 2017, many enhancement is done in this area

    • Object Initializer: It will allow you to create the instance of a class along with its properties without writing the whole code line by line.
    • Out keyword: declaration of out variable can be done inline, new in C#.
    • Null-coalescing operator can be replaced easily in place of if statements.
  • Preview of .NET Core and Docker:

    Option included during installation to install .NET core preview in the new version of VS. Web publish is moved from powershell to MSBuild in .NET Core Projects. You can also cross reference between .NET Framework project or Xamarin project. Asp.NET Core projects will have Docker support, building the project and delivering it to Azure all within Visual studio. This feature is still in development, there are many points missing for starting a full development.

  • Live Unit Testing:

    First, this feature is available on Enterprise edition only. It will allow you to see unit test result when you are writing your code and works perfectly in C# and VB projects even when there are other projects in solution. The usability of this feature has been improvised.

  • XAML Editor:

    It is also improved in Visual studio, which now support for including namespace and creating prefix of the type while writing the code for Xaml document. Rename refactoring is now also possible for the namespace prefix. Unnecessary and no longer used namespace can be removed with just a simple command. .editorconfig support is included for Xaml documents, you can easily define various styles for xaml documents in .editorconfig. Overall, it has been improved in performance and for better development.

Summary

With all the new great features for development and see final results with great productivity, Visual studio 2017 stand out to be the best integrated developing environment for .NET software development companies in India. There is also a preview of Visual studio available for mac mostly for development of native mac apps and mobile apps. It is more focused on cloud development, so developer can share their source between Windows and Mac. There is a full list of features included in Visual studio 2017 which can be found here.

ASP.NET SignalR for real time applications

Introduction SignalR is a new library for .NET software development companies that is used to a

Introduction

SignalR is a new library for .NET software development companies that is used to add real time web functionality to ASP.NET applications. Real Time functionality is the ability to have put your server side code content to connected clients instantly as it becomes available, rather than having the server wait for a client to request a new data.

SignalR provides a bidirectional communication channel between (web) clients and a server side (web) application. SignalR is not limited to web application. A client can be every application or web page which uses JavaScript or .NET Framework 4.5 (or 4 with some restrictions) - like Windows Phone apps, SilverLight or Console applications. A SignalR server application has to be build with .NET Framework 4.5 (or 4 with some restrictions).

                        

SignalR provides two communication levels:

  • Persistent Connection API - low level, message-oriented communication
  • Hub API - high level, allows direct call of client and server methods

The Hub API offers the most convenient and preferred communication API. The Persistent Connection API might only be interesting, if you need to integrate with an existing message based server application or if you need for some reason detailed control on the message level.

How it is different?

SignalR is the latest library in ASP.Net, the 'real-time' framework that allows the server to execute methods on the client.  We are not limited to this interaction, and we can expose server-side methods to our clients.  This potentially allows for a much cleaner interaction between client and server, as all data is passed through arguments or the result of a method call.  SignalR clients are available for a variety of platforms, and a client-side is generated for all of the server-side methods that are exposed to the clients.

Analysis of ASP.NET SignalR

Advantages

  • Not restricted to web clients
  • Selection of the best available communication mechanism automatically
  • Binding complex objects (JSON)
  • Open-source solution available on GitHub that can be installed via NuGet
  • Bidirectional communication for (web) clients
  • Easy to setup
  • Install by issuing NuGet command: “install-package Microsoft.AspNet.SignalR“. 
  • SignalR can run inside a web application or self-hosted.
  • Easy to debug. It can run in IIS Express. All the powers of Visual Studio just wait to be utilized.
  • Very good documentation and tutorials

Disadvantages

  • Not a reliable communication
  • ASP.Net Software development companies should not use it if a guaranteed delivery of messages is mandate. Bank Transaction are a negative example.
  • It uses dynamics. Some syntactical errors can only be detected at runtime. However, only a few lines of code are affected. So, it’s not a real problem detected all errors related to the usage of dynamics.
  • At times, it’s difficult to attach a debugger to the running process, especially, under heavy load.
  • Allows only 10 connections when running in IIS in desktop systems.
  • Web clients and the server use different technologies so there is not much code reuse between them.

Simple Chat Application with MVC

  • In Visual Studio, create new project with C# ASP.NET Web Application and click ok.

                          

 

  • In the New ASP.NET Project window, select MVC, and click Change Authentication.