where developers meet development
Sunday,February 05,2012
Micro Focus Integrates Visual Studio 2010 in Cobol Tools   Micro Focus has announced four new Cobol products to allow developers to...
ODA Open Design Alliance Announces DWGdirect.NET Beta Release   The Open Design Alliance (ODA) announces the beta release of DWGdirect.NET,...
Use Intel Alpha SDK to Write Netbook Applications and Earn Money   Intel has announced a new opportunity for developers to earn money by writing...
Hot and Safe: a Beginner's Guide to Multithreaded Libraries   Most of the discussion of multithreading that emerges from Cilk Arts is...
8 Simple Rules for Designing Threaded Applications   Multithreaded programming is still more art than science. This white paper...
 

EXCLUSIVES 

Writing High Performance .NET Code

Picture Holder1

Since most day to day operations are moving online (Core banking, Reservations, Shopping), software performance has become vital to their success. So many times visits to a web site takes long time to load, resulting in frustration and the migration to a different site (similar business). For businesses this can be fatal as they lose customers. Web sites often slow or even go down when traffic increases. Performance/stress testing of your application can help avoid such downtime. There are tools that tell you performance of your application is bad but not necessarily why. But if you have information knowing what to look for, what is good and what is bad, will put your application in better shape later.

With Microsoft® .NET Framework, developers can now build complete business solutions quickly with more functionality and robustness with its rich and easy to use features and functionality. But with this comes increased opportunity for architects and developers to design and build poor, non scalable solutions because architecting and designing these solutions are not really very straight forward. This paper talks about the core performance related issues that one should be aware of in .NET. This paper also talks about some common mistakes which one should avoid and many tips for writing high performance .NET code.

This paper will discuss:

  • .NET Framework components and CLR execution Model
  • Threading support in .NET and tips for avoiding common threading mistakes
  • Automatic Memory management – Writing GC friendly code
  • Briefly talks about performance tools available for tuning .NET code
.NET Framework Components and CLR execution Model

The .NET Framework provides a run-time environment called the CLR, which manages the execution of code and provides services that make the development process easier. CLR provides features such as automatic memory management (GC), exception handing, security, type safety, JIT (Just in time compiler for converting msil to native code) and more. CLR is implemented as a dll called “mscorwks.dll”. It also has support for Base Class Libraries (BCL) which sits on top of CLR, providing libraries for functionalities such as String, File I/o, and Networking, Collection classes, Data Access (ADO.NET) and XML processing. On top of BCL there are presentation layers (Web Forms and Windows forms), which provide UI functionality. Last, one finds the languages that Microsoft ® provides for .NET. Currently there are more than 15 different languages that are targeted for .NET framework.


Figure 1: .NET Framework Components and CLR execution Model

Each Language has a compiler which compiles and converts the code to msil (Microsoft® Intermediate Language). There are multiple optimizations that are built into each of these compilers which produce efficient IL code. Then CLR takes over and it has the JIT compiler convert this IL code into native code that CLR can execute. The JIT compiler also has many optimizations built in which can produce efficient native code for better performance. If the code is unmanaged, then we bypass most of this and can directly run unmanaged programs. Note that .NET provides additional features by which we can use pointers to access arrays etc through a feature called “unsafe” for better performance.


Figure 2: CLR Execution Model

JavaScript for the C# Developer   With the proliferation of thin-client web applications, sooner or later every C# programmer will likely have to write some JavaScript. What could go wrong? After all, it's just another...
JavaScript for the C# Developer   With the proliferation of thin-client web applications, sooner or later every C# programmer will likely have to write some JavaScript. What could go wrong? After all, it's just another...
.Net Collections Deep Dive   The .NET framework provides a rich set of collection classes, crafted to help you address a multitude of tasks. But, let’s face it, we rarely use this vast array to the scope that...
Caring about Code Quality   We all have seen our share of bad code. We certainly have come across some good code as well. What are the characteristics of good code? How can we identify those? What practices can...
Design Patterns for .NET Programmers   Between lambda expressions in C# and functional programming in F#, we can now make use of patterns well beyond those popularized by the so called GOF. In this presentation we will learn...
Stepping into the Near Future of the IDE   Ever wonder what it might be like to write code in the future? DevExpress’ Mark Miller will explore trends in tools & human interfaces and preview interesting & exciting...
Quality First - Building Quality Into Your Application Throughout the Lifecycle   Application quality is often considered as an afterthought and put off until late in the application lifecycle. To consistently deliver high quality products, quality should be...
The Entire Game Should Move Onto the GPU, says Rev Lebaredian   As the computing functionality and horsepower of GPUs has grown over the last few years, the role of the GPU is rapidly expanding to game tasks beyond rasterization-based graphics. Now...
To:
Name:*
E-mail address:*
Your Details:
Your name: *
E-mail address: *
Message:
Software Supportby Advanced Millennium Technologies

Advanced Millennium Technologies. Expertise in software development, offering consultancy services, Open source programming, CRM - Customer Relationship Management, CMS - Content Management System , ERP - Enterprise Resource Planning and Ecommerce development, AJAX, PHP, .NET, J2EE, SOA, XSLT, DOJO toolkit development and software testing. A robust onsite-offshore model. A well-defined global delivery model. AMT Outsourcing center. www.amt.inTAROBY - The E-Mail Dashboard for EntrepreneursTaroby is a SaaS based messaging and collaboration suite inbox that enables sharing of email accounts among team members. The unique concept of 'Team Inbox' makes Taroby an excellent enterprise collaboration suite for enterprises. Taroby is an effective tool for CEO's and entrepreneurs to manage multiple departments or manage multiple projects under them. The team inbox gives the entrepreneurs an overview of what is happening their business and give a quick snap shot of the employees who is responcible for handling the tasks/emails. For team members taroby brings in transparency and efficiency in their teams. Taroby improves the internal and external communication in an organization. Using the Taroby's Team Inbox also helps in reducing the usage of disc space and there by helping the enterprises to reduce carbon footprints.