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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:31:47+00:00 2026-06-05T10:31:47+00:00

I am reading in statistical data from running a program with different configurations. Let’s

  • 0

I am reading in statistical data from running a program with different configurations. Let’s say there are 6 configurations (a, b, …, f). The configurations may not change linearly, so if you think of the measurements as a table, there could be gaps in the table. The question is regarding structuring these statistical data in memory.

The first thing that comes to mind is to read these configurations to a dynamically allocated 6-deep array or arrays:

struct data ******measurements;

Now this works fine. You have very little memory overhead (only the configurations that have data will actually be allocated) and the access time is O(1).

Besides the fact that most people don’t like ****** pointers, this has the downside that adding configurations means adding dimensions to the array, which could get ugly unless read/write to the array is encapsulated in a function. (Write is already encapsulated to take care of allocation when necessary, so this in fact is not such a big deal).

Another idea that comes to mind is to use a map of struct config to struct data using an AVL tree or something (which I already have so has no implementation overheads). This solves the problem of extending the configuration parameters, but decreases access time to O(log(n)).

The number of tests could get considerably large for the O(log(n)) to make a difference.

My question is: Is using a 6-deep nested array here justified? Or is there a better way of doing this?

  • 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-06-05T10:31:49+00:00Added an answer on June 5, 2026 at 10:31 am

    The real performance bottleneck (besides wasting memory) are not computations but the number of indirections and cache misses that you will encounter. These can dominate by a factor of hundred to thousand the computation of indices and stuff like that. So your best choice is to reduce the number of indirections and invest a bit into computation. As far as I can see this would best be done by hashing your 6 indices. This would reduce your indirections to two, first looking up the value (probably a pointer) that is stored in the hash table, and then fetching the data that your are interested in directly.

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

Sidebar

Related Questions

In an application at our company we collect statistical data from our servers (load,
Reading some posts from Jimmy Boggard and wondering - how exactly is it possible
Reading Java Concurrency In Practice, there's this part in section 3.5: public Holder holder;
After reading the tips from this great Nettuts+ article I've come up with a
Disclaimer: please do not bother reading this long post unless you are an embedded
I'm having a weird time reading from my application's profiling code on Linux so
When using SSIS to load data from a source table, we have a OLE
I am reading Elements of Statistical Learning ESLII and in chapter 2, they have
Reading this post here on stackoverflow want to load a different css when compiling
I have really strange behaviour while reading files from /proc If I read /proc/pid/stat

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.