[.net] C# speed tips
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
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..
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..
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.
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
P.S. For those interested in the subject there's also this page on MSDN
Calin
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement