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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:46:37+00:00 2026-05-16T14:46:37+00:00

I got some objects with certain values, for example: (1) struct massPoint { double

  • 0

I got some objects with certain values, for example:
(1)

struct massPoint {
    double pos;
    double vel;
    double acc;
} objects[LOTS];

or the same in arrays:

(2)

double pos[LOTS];
double vel[LOTS];
double acc[LOTS];

First question: Is it right if i call (1) padded data and (2) serial data?

Second question: If i do some operations which would only affect vel and acc and no pos, and i have LOTS of them, would (2) be preferable since it would be better in terms of caching performance because the pos[] dont have to be cached this way and in (1) it has to? Or do i not get the concept at all?

  • 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-16T14:46:38+00:00Added an answer on May 16, 2026 at 2:46 pm

    No idea for your first question

    For your second question there is no general answer this depends on your architecture and of your usage pattern.

    • if you really have random (=
      unpredictable) access and each double
      makes up a cacheline and your data is correctly aligned both would be
      equivalent in terms of caching.
    • your second method is clearly
      superior on modern architectures if
      you have streaming access to the
      data, that is for which the compiler
      / runtime / hardware can easily
      predict the future access and that have enough hardware registers for the all the pointers and the data
    • your first method could be superior
      in cases you have only few registers,
      since for the second the compiler
      might need to keep track of your
      current index in the three different arrays

    so in summary it may depend on a lot of factors, but a tendencies that the second method would be preferable under many circumstances

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

Sidebar

Related Questions

I've got some nested objects in rails. User -> has_many :tasks -> has_one :location.
I've got this schema: Silverlight4 project 1a. silverlight class library project with some objects
I've got some inherited code that has a tendency to pass objects around as
Hallo all. I got a javascript object with some propeties let's say function Animal()
I've got a XML object that is shared by some components. Is it possible
got some problems. Built an applet that has to be used step-by-step. After each
Got some code that is not mine and its producing this warning atm: iehtmlwin.cpp(264)
got some problems deploying a java web application on jboss 7.1... Stepped through the
I got some quite strange errors compiling code under gcc. It tells me that
I got some pretty messy urls that i got via scraping here, problem is

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.