Tim Scott

All things for a good .NET geek

  Home  |   Contact  |   Syndication    |   Login
  36 Posts | 0 Stories | 4 Comments | 33 Trackbacks

News


Archives

Post Categories

Image Galleries

Coding

TechEd

Designing Connected Systems with the .NET Framework and an Eye on the Future

This session covered architecture, patterns, and philosophy to keep in mind when developing connected apps.  It brought up some comples issues (at least from my level).  Will have to ponder.  Stuff like service oriented architecure, data contracts, Indigo...They're more than just words, and this presentation helped bring it all together. Heh, but not well enough for me to blog it yet.

Developing High Performance Applications with the .NET Compact Framework

This was a very practical session that gave strong tips on how to increase performace of apps written for the .NET Compact Framework.  Some of these apply to the desktop apps, too.

  • Use .NET CF 2.0--it has around 2x better performance than 1.1
  • Avoid String concatenation--use StringBuilder (this is an oldie but goodie)
  • Run micro-benchmarks to test assumptions (more)
  • Avoid Garbage Collection from unneeded boxing/unboxing (using strongly-typed collections or generics can help.  See Roman Batoukov's blog for Generics in the .NET cf)
  • Avoid finalizers, they are expensive and extend the life of the object. Instead, implement IDispose pattern.
  • Exceptions are expensive!  Don't use as part of normal flow control.
  • Reflection in costly, can be 10x to 100x slower.  Adds working set burden.
  • Override ToString(), GetHashCode(), and Equals() in your value types to prevent reflection implementing those calls.

Stuff to do in the BCL:

  • Pre-size your collections--resizing is expensive
  • Beware of foreach in large collections.  Use indexers instead.
  • Winforms: Pre-load and cache your forms before showing them.  Also avoid lengthy ops in Form.Show()
  • XmlTextWriter/XmlTextReader faster and smaller than XmlDocument

Data

  • Data stored in SQL Mobile is faster than XML, text, or binary filesystem (!)
  • Avoid DataSet, use DataReader instead

Web Services -- Depends where the bottleneck is (network or CPU). See Mike Zintel's comprehensive post on determining this.

What can we look forward to in next versions of .netcf?  Live perf counting, CLR Profile and Call Profiler; plus improvements to web services, and More Speed!

 

posted on Friday, June 10, 2005 12:22 PM