Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   Pilot's Lounge (http://forum.fulqrumpublishing.com/forumdisplay.php?f=205)
-   -   Is C# part of the problem? (http://forum.fulqrumpublishing.com/showthread.php?t=30774)

mazex 04-02-2012 07:04 AM

Quote:

Originally Posted by Thee_oddball (Post 404902)
Maze i found a nice read you might enjoy




heres the whole article http://www.developerfusion.com/artic...t-performance/

Thanks, that's a good article about why we changed back to C++ for our project ;) Unfortunately, in the period around 2005 many deveopers where experimenting with mixing managed and unmanaged code, so I can understand how they thought at that time. I'm pretty sure they would have thought differently today?

/mazex

mazex 04-02-2012 12:04 PM

Found an interesting article with a benchmark of managed vs unmanaged DirectX... As you can see the interop hits the render performance hard...

http://code4k.blogspot.se/2011/03/be...1-apis-vs.html

But SharpDX looks interesting...

From the summary:

"Ok, so if you are a .NET programmer and are not aware about performance penalty using a managed language, you are probably surprised by these results that could be... scary! "

Thee_oddball 04-02-2012 01:57 PM

Quote:

Originally Posted by MadBlaster (Post 404928)
These points stand out.

"Now here's the rub. Marshalling is computationally expensive, and the more data you move back and forth, the more expensive it becomes. Marshalling data structures one way can add as much as 3,000 instructions to your processing time for complex data. "


"By investing a little time early in the development phase, you can ensure that you made the right performance choice and not have to go back and make substantial changes after you have a working application. "


Can we call CLoD a case study at this point?:-P

Jmho, the author comes across bias to managed mode programming. It's a good article though. Hopefully CLoD coders have access to the tool(s) the author speaks about to optimize the interop.

try this article http://www.codeproject.com/Articles/...-Csharp-vs-NET

MadBlaster 04-02-2012 05:45 PM

Another great article. Most of it I have to take in at a high level due my limited knowledge. I would guess the Suduko test involves heavy recursion/backtracing to compare memory allocation/de-allocation times of heap-dynamic arrays (C#) verses stack-dynamic arrays (C++)? Anyway, I'll bookmark this one for re-read in few months. In the meantime, I'll throw his gc quote on the pile as this guy seems an expert to me.

"Memory management concerns (not benchmarked here) are different in C# than C++. In particular, C# memory allocations are extremely fast, but the garbage collector is a wildcard: it may be fast or slow depending on your memory allocation patterns. And Microsoft has not provided any good way to measure GC performance. There are various guidelines to optimize GC: let objects die young where possible, avoid thick pointer trees (e.g. linked lists or SortedDictionary, a red-black tree), and so on; but it's really outside the scope of this article."

Thee_oddball 04-02-2012 09:43 PM

Quote:

Originally Posted by Codex (Post 404933)
Memory leaks can occur in any language, no matter if a garbage collector is present or not. It's comes down to following good coding practices, it's especially important when making interop calls.

For me I have no doubt that CloD is written in C# due to early error messages people were posting after release. Also the only official Microsoft "Direct X" API that operates on .NET is XNA, however this is capped at DX9 so you can safely say that they CloD is making calls to the un-managed version of Direct X which is the current main stream API of choice.

Maz is right, interop calls are taxing and I wouldn't be surprised it that has been the main cause of all the issues because I get the "feeling" that this style of programming for a game is still in it's pioneering days.

did they really start writing this in 2005 in .NET 2.0?

Thee_oddball 04-02-2012 09:47 PM

Quote:

Originally Posted by mazex (Post 405081)
Found an interesting article with a benchmark of managed vs unmanaged DirectX... As you can see the interop hits the render performance hard...

http://code4k.blogspot.se/2011/03/be...1-apis-vs.html

But SharpDX looks interesting...

From the summary:

"Ok, so if you are a .NET programmer and are not aware about performance penalty using a managed language, you are probably surprised by these results that could be... scary! "

nice read :) SharpDX does look good :) i wonder what CLoD uses?

Codex 04-02-2012 10:05 PM

Quote:

Originally Posted by Thee_oddball (Post 405131)

Thanks for this link! I've been programming professionally for only a couple of years and I was told to subscribe to CodeProject from day one. I've never found that article :P Awesome stuff in there.

mazex 04-03-2012 06:38 AM

Quote:

Originally Posted by Codex (Post 405274)
Thanks for this link! I've been programming professionally for only a couple of years and I was told to subscribe to CodeProject from day one. I've never found that article :P Awesome stuff in there.

Yup, a lot of good stuff there. If you don't hang out at stackoverflow I can really recommend their forums too. Extremely active for all kinds of programming discussions... That's where the really hairy guys spend their nights ;)

/mazex

Codex 04-03-2012 08:08 AM

Quote:

Originally Posted by mazex (Post 405336)
Yup, a lot of good stuff there. If you don't hang out at stackoverflow I can really recommend their forums too. Extremely active for all kinds of programming discussions... That's where the really hairy guys spend their nights ;)

/mazex

yep stackoverflow is my homepage when I'm working. :cool:

Thee_oddball 04-04-2012 10:46 PM

here is another engine for you Maze it Use's the ogre3d render http://www.neoaxis.com/
http://www.ogre3d.org/


huh? maze did you delete your post?


All times are GMT. The time now is 11:28 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.