Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:47:41+00:00 2026-05-25T01:47:41+00:00

I am writing a game using C# 2010 and XNA 4.0. I want it

  • 0

I am writing a game using C# 2010 and XNA 4.0. I want it to be a good game and not some “just another crap” and so one of my goals is good framerate. For this I would like to ask you for some advices, be it XNA related or C# related – what can I do to speed up my code and so improve FPS.

Here is some stuff I found out:

  • (c#) using array insted of list<> will improve performance a lot, in case you want to access huge amount of data (or even lots: having an array of 20000 items gave almost 180% FPS of list of 20000.
  • (c#) using for instead of foreach will improve performance. On same 20000 elements it’s like 5-10% difference.
  • (xna and c#) calling methods costs performance, so when I scattered my code into methods what called other methods and such, and everything was so cool and object oriented it was on the cost of 1-3 FPS each call.
  • (xna) update vs. draw: it was no difference in performance when I put code into update() and draw(), so if you do not care much, you do not have to put some methods under update() instead of keeping everything together in draw() in hope of better FPS.
  • (xna) no idea if it is me or just 4.0, but when you load a .X with lot of textures in it and pretty complex meshes, it takes a LOT of time to load. I had to write my own .X loader and mesh/model renderer just because XNA started to load texture for each and every triangle regardless if the previous one had the same texture to it. Even writing my own contentloader which caches textures for you is no solution, because it is still utilised a lot of times. If you make something nice and fluffy I suggest using drawuserprimitives and not Model class. (no idea if it is 4.0 only, or 3.1 had such performance problem too)
  • (xna and c#) Try to avoid using “new” when it is about drawing. I saw some code around on web, what was copy/pasted together and had “basicEffect = new BasicEffect(graphicsDevice);” and such uglyness in the draw(), and even worse: in iterations inside draw(). Such will kill performance. Instead of this have one such class in “game” or in a static class. This applies for other “temp-objects” too: ugly but I think it is better to create something global and use it with attention then to make a nice and fluffy code what will make our game because of garbage collector.

Ok, so to make long story short, please post some good advice here, so I / we can make good, fast and optimized games 😉

Thanks in advance:
Zéiksz

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:47:42+00:00Added an answer on May 25, 2026 at 1:47 am

    UberGeekGames has a good article on XNA optimization. It’s mostly targeted at Xbox and WP7, but many of the things also apply to PC.

    http://www.sgtconker.com/2011/05/high-end-performance-optimizations-on-the-xbox-360-and-windows-phone-7/

    Original site is dead, but is available in the Internet Archive:

    Archived version of High end performance optimizations on the xbox 360 and windows phone7

    The rule of thumb is “profile before optimizing”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a game in Visual Studio 2010, using the XNA 4.0 framework. I
I've begun writing a game using XNA Framework and have hit some simple problem
I have am writing a small game using Applet. I want to be able
I'm writing an XNA game in C# using the XNA port of Box2d -
I'm writing a game for iPhone, and I want an online leaderboard using mySQL,
I'm writing a game using Swing and want to achieve a distinctive steampunk inspired
I'm currently writing a small online game using c# XNA and lidgren and I
I'm writing a networked game in C++ using Winsocks 2.2, using Visual Studio 2010,
I'm writing a game for Android using libgdx. Here is some code that draws
I am writing a game using Java Swing. I want to paint each time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.