[.net] C# speed tips

Started by
7 comments, last by Cygon 16 years, 9 months ago
Does anyone know resources that talk about the execution time for various C# code snippets? I'm trying to build the engine of my game speed wise. I'm looking for things like those found here but on a wider range of topics. Calin

My project`s facebook page is “DreamLand Page”

Advertisement
This is not exactly what you were looking for but...
I use Microsofts fxCop to check my code for performance issues and other "bad things" and most of my performance errors it gives me has to do with creating strings when I don't need to. Not sure if this program will help, but it also checks for lots of other things too..
my blog contains ramblings and what I am up to programming wise.
That kind of information is very distributed, and very context-sensitive anyway. Trying to be this concerned about narrowly-focused performance up front is likely only going to lead you astray. What would be more beneficial is for you to actually get your code working, then isolate the bottlenecks with NProf or some other profiling tool, and use that to guide your research, as it will give you a specific area to focus on.
Rico Mariani has a blog that discusses performance. Some of his posts are quite high level, while others focus on areas of .NET such as exceptions and memory leaks due to event handlers.

Some reading to keep you busy for a while.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
There is a good article on the performance of data structures on the XNA Creators Club.
Washu talks a lot about this.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Wow. Thanks everyone, it will take some time to chew everything.

P.S. For those interested in the subject there's also this page on MSDN

Calin



My project`s facebook page is “DreamLand Page”

C# performance is quite good and you shouldn't have any issues with plain logic code. The only thing worth optimizing (apart from using brute-force algorithms in stupid places, of course) is to keep the GC happy when you're designing larger projects.

There's lots of useful information in Shawn Hardgreaves' blog:
Twin paths to garbage collector nirvana
Delegates, events, and garbage

Once you digested that information, just focus on writing elegant and understandable code, any performance bottlenecks can be found with Microsoft's free CLR profiler:
Check out CLR Profiler 2.0

-Markus-

[Edited by - Cygon on July 18, 2007 12:51:31 AM]
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.

This topic is closed to new replies.

Advertisement