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 7618779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T03:29:35+00:00 2026-05-31T03:29:35+00:00

If I have a game which has a 3D world, and the world is

  • 0

If I have a game which has a 3D world, and the world is quite big, so needs to be split into chunks, is there a major, if any, performance advantage of having 128 byte chunks over, say 150 byte chunks? Obviously, the objects in the chunks are still a whole number of bytes in size.

i.e. Is chunks[128][128][128] faster than chunks[150][150][150] or chunks[112][112][112]? Are there any other side effects such as excessive RAM wastage afterwards? Are there any other factors that should be taken into consideration?

I just see that it’s a convention to store everything in variables and arrays of sizes that are powers of 2, but I’m not sure whether there’s any merit to it, and if it could be better to use more human numbers like 100 or 150.

  • 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-31T03:29:37+00:00Added an answer on May 31, 2026 at 3:29 am

    The other answers are indeed correct that power-of-two sized data will benefit from using shifts over multiplies.

    However, there is a dark side to power-of-two size data. And it can hit you when you least expect it.

    See these two question/answers:

    • Matrix multiplication: Small difference in matrix size, large difference in timings
    • Why are elementwise additions much faster in separate loops than in a combined loop?

    When your datasets are powers-of-two, they are more likely to be super-aligned in memory. (meaning their addresses will likely have the same modulo over a large power-of-two.)

    While this may seem desirable, they can lead to:

    • Conflict Cache Misses
    • False Aliasing Stalls (mentioned in the second link above)

    If you read the two questions linked to above, you can see that alignment can cause a slow-down of more than 3x – which will likely far out-weigh any benefit you get from using shifts as opposed to multiplies.


    So as with all performance questions, you need to measure, measure, measure… And be prepared to expect anything to happen.

    You mention that you are representing a 3D-space – that is exactly the kind of situation that would exhibit power-of-two strided memory access that could lead to slow-downs.

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

Sidebar

Related Questions

I have an XNA arcade game which runs over Silverlight environment. The game has
I have an game app which occasionally plays sounds. When the phone goes into
My question is really short. I have a game which has a reset class
I have dabbled in the Microsoft XNA game development framework which seems quite good
I have made a game which is nearly identical to Popcap's Atomica. ( http://www.popcap.com/gamepopup.php?theGame=atomica
I have an animated game which is generally achieving 25-30 frames per second, though
I have a game app which is mostly working fine. If a phone call
I have an iPhone game which I am porting to PC. The game uses
Imagine you have a PlayN game which uses Guice bindings in its core project:
I have a Game Window to which I am trying to put W ,

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.