Chapter 14. High-Performance Programming


IN BRIEF

Throughout the rest of this book, you will see how to improve the performance of your ASP.NET web applications and speed up your Windows Forms applications, your Web Services, and much more.

You can learn all the performance techniques in the world for each application type, but they won't help you very much if the code you write at the lowest level doesn't run as fast or use memory as efficiently as it could.

This chapter will demonstrate how to create high-performance C# code by showing you valuable techniques for memory management, dealing with the Garbage Collector, and speed techniques to improve the basic code that will be used in web applications and Windows applications alike.

WHAT YOU NEED

REQUIRED SOFTWARE

.NET Framework SDK v1.1

Visual Studio .NET 2003 with C# installed

RECOMMENDED HARDWARE

PC that meets .NET SDK minimum requirements

SKILLS REQUIRED

C# and .NET familiarity


HIGH-PERFORMANCE PROGRAMMING AT A GLANCE

Introduction to Garbage Collection

295

  
 

Garbage Collection InternalsGenerations

295

Caveat: Nondeterministic Finalization Versus Deconstruction

297

 

Coding with the Garbage Collector in Mind

296

  

Memory and Class Management in the Common Language Runtime

300

  
 

Boxing and Unboxing

300

Using the StringBuilder Class

303

 

Collections and Boxing

302

  

High-Performance Code: Best Practices

305

  
 

Using Exceptions

305

Tip: Using AddRange on Collections

307

 

Chunky API Calls

305

 

Value Versus Reference Types

306

Jagged Versus Rectangular Arrays

308

   

For Versus Foreach

308

   

Utilizing Asynchronous I/O

310

Summary

310

  

Further Reading

310

  




    Visual C#. NET 2003 Unleashed
    Visual C#. NET 2003 Unleashed
    ISBN: 672326760
    EAN: N/A
    Year: 2003
    Pages: 316

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net