.NET news » Performance Performance Rss Feed

Cache In On the Enterprise Library Caching Block for .NET 2.0

Nearly every application needs to cache data. While you're probably familiar wth the caching functionality built into ASP.NET, the Enterprise Library Caching Block provides in-memory, file-based, or database caching storage for all your other .NET applications.

Performance Quiz #9 : IList List and array speed -- solution

In the test case as given there's a great deal of repeated work extracting the length of the array and accessing the items. This is because of the unusual property that arrays have -- they implement IList for potetially more than one T even due to inheritance. In the interest of economy alone then it is worthwhile to consolidate the IList implementations into some kind of secret helper but this has some consequences.

Short results:

Test Case Milliseconds
Test1: Array 54
Test2: List<> 8
Test3: ArrayWrapper 14
Test4: Array via foreach 9
Test5: List<> via foreach 11
Test6: Array via special 6
Test7: List<> via special 8
12 Mar 2006, 08:46:00   Source: Performance Quiz #9 : IList List and array speed --...   Tags: Performance

Performance Quiz #9 : IList<T> List and array speed

A short and sweet quiz with lots of juicy discussion possibilities:

public int Sum(IList<ushort> indices)
{
int result = 0;
for (int i = 0; i < indices.Count; i++)
result += indices[i];
return result;
}

Considering only the time it takes to do the Sum (i.e. assuming we had already set up the array/list) which gives better performance and why?

// #1
ushort[] tmp = new ushort[500000]; // this doesn't count
Sum(tmp);// this is what we are timing

OR

// #2
List<ushort> tmp = new List<ushort>(500000); // this doesn't count
for (int i = 0; i < 500000; i++)tmp.Add(0); // this doesn't count
Sum(tmp); // this is what we are timing

What say you gentle readers?

9 Mar 2006, 18:31:00   Source: Performance Quiz #9 : IList<T> List and array speed   Tags: Performance C#

Get Control and Performance with the Real Time Stylus API

The Real Time Stylus API provides an alternate way to receive pen input pen. This high performance API provides a great level of control to developers for a small penalty in added effort.

Power to the People

Software can have a huge effect on the life span of a battery; scaling down functionality is an easy way to drastically increase the lifetime of mobile PC battery. Do your users a favor and find out how to optimize your applications' power requirements.
18 Feb 2006, 01:05:56   Source: Power to the People   Tags: Mobile Performance

High-Performance .NET Application Development & Architecture

This article demonstrates the art of creating and architecting high-performance and scalable .NET applications, covering all stages, from planning to development and their perspective best practices.

NCache 2.0

NCache is a high performance in-memory object caching solution for mission critical .NET applications with real-time data access needs. NCache not only lets you cache read-only data but also complex transactional data with relationships. As a result, your application can cache most of its data and dramatically improve performance.
30 Jan 2006, 11:27:23   Source: NCache 2.0   Tags: Components Performance

.NET Framework: Introducing Generics in the CLR

Generics are a shipping feature of the .NET Framework 2.0, and managed code is faster, more maintainable, and more robust because of it. Jason Clark provides an in-depth look.
24 Jan 2006, 21:21:37   Source: .NET Framework: Introducing Generics in the CLR   Tags: Performance

Exceptions and Performance in .NET

Almost every time exceptions are mentioned in mailing lists and newsgroups, people say they're really expensive, and should be avoided in almost all situations. Jon Skeet examines the claim.
19 Jan 2006, 12:49:00   Source: Exceptions and Performance in .NET   Tags: Performance

How to Write High-Performance C# Code

Writing code that runs quickly is sometimes at odds with writing code quickly. C.A.R. Hoare, computer science luminary and discoverer of the QuickSort algorithm, famously proclaimed, 'Premature optimization is the root of all evil.' The extreme programming design principle of 'You Aren't Gonna Need It' (YAGNI) argues against implementing any features, including performance optimizations, until they're needed.
12 Sep 2004, 19:00:00   Source: How to Write High-Performance C# Code   Tags: Performance C#