Game Development Community

XNA, Managed code performance

by Bryan Stroebel · in General Discussion · 09/01/2006 (12:59 pm) · 7 replies

Do you think that the small disadvantage in the speed of managed code games can be fixed by the use of a multi-core processor? So, instead of having one thread that handles everything we could create a few threads where each thread handles a specific task (e.g. rendering, physics, Disk I/O).

XBOX 360 has a 3 core processor so maybe that could be one way of gaining performance.

#1
09/01/2006 (1:06 pm)
It depends on how XNA lets you access and thread your application on the 360. But it is definitely something to keep in mind, especially in terms of putting the right stuff on the right processor for optimization.
#2
09/02/2006 (2:31 am)
Yes, you will have access to threads with XNA. 6 in fact. 2 per core. I read that on the blogs or faqs of the xna guys.
#3
09/02/2006 (9:24 am)
For some reason I recall that XNA was only going to allow us to access three or four of the six available on the 360. Why? I have no idea but I could be wrong. We'll have to do more searching.
#4
09/02/2006 (1:31 pm)
Luke,
If that's true, I would like to know why also. Not that I think it's too big of a deal but I would like to know the logic behind it.
#5
09/02/2006 (7:18 pm)
Luke, you're right. I forgot about that. They are using a Thread to run the system itself. :P But I thought they were only using 1 of them. But it was a few days ago that I read the blog or whatever it was. I've read so much in the last week about this. :P
#6
09/04/2006 (1:56 am)
From Rob Unoki, Common Language Runtime Development Lead [MS]:

"Correct - 3 cores 2 hardware threads (HT) each. Threads on the 360 have a hard affinity. The xbox os scheduler only schedules the thread on a single HT. We will be providing an API in the Thread class to explicity set the current thread's hard affinity. Note - not all HTs will be available for use by game devs. Some may be reserved for future purposes."
#7
09/05/2006 (11:18 am)
If you are worried about performance, i strongly recomend that you go look how the CompactFramework garbage collector works, as this is what the 360 uses.

mostly, your gen2 objects should be created as arrays with some sort of lookup function, minimizing the use of pointers.