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

  • Home
  • SEARCH
  • 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 8203009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:23:39+00:00 2026-06-07T07:23:39+00:00

I am working on a program which does a lot of manipulation on objects;

  • 0

I am working on a program which does a lot of manipulation on objects; creating, deleting, dynamic_cast-ing them, shuffling around pointers, comparing contents etc. Most of these objects are at least 40 bytes (up to ~90 bytes), and there may be upwards of 10,000 of them in memory at once.

What I’m trying to determine is whether I should bother trying to decrease their size. I could profile constructors, new, delete, etc. However, I am lead to believe that the most important performance hit from large objects is from cache unfriendliness. Is there a way to determine the contribution of the size of objects on the number of cache misses that happen?

PS: I imagine excessive use of dynamic_cast also affects performance. However this is much easier to diagnose.

EDIT: I know that it’s useless to optimize without profiling. What I am asking is how do I determine, from profiling, if it is a problem. Is it possible that the penalty is distributed throughout the code such that standard profiling tools won’t be helpful?

  • 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-07T07:23:41+00:00Added an answer on June 7, 2026 at 7:23 am

    You are approaching it the way most people do, until they cross the line and Get It.
    As Paul R said in his comment, don’t just guess.
    To put it another way, your entire approach should be centered around diagnosis.
    Otherwise you are like a medical doctor who treats people by assuming that everyone is alike, and what works for the goose must work for the gander.

    Does that mean cache-related issues are not a problem?
    Does that mean memory-allocation issues are not a problem?

    Not necessarily.

    It means they are guesses and they might be problems, but there almost certainly are other problems that nobody could guess in advance.

    There’s an example discussed here where six (6) different problems were found and fixed, having a range of sizes that just happen to add up to nearly all the time, the way a bunch of coins of different sizes can add up to a dollar.
    Sure, one of them was memory allocation, but only one.
    If you had fixed the memory allocation problem and stopped there, or that plus some other preconceived problem and stopped there, how much speedup would you have gotten?

    A fraction of the speedup ratio that was actually displayed.

    To get the real speedup ratio that you can reach, you have to find every problem, not just a few.
    That link shows how to do it.

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

Sidebar

Related Questions

So I've been working on program in which I'm creating a hash table in
I wrote a multi-threaded program which does some CPU heavy computation with a lot
I am working on a simple program which requires me to be able to
I'm developing a simple program which makes a Python script executable, and I'm working
I am now working on a program for Android which is something related to
I'm am currently working on a program in java which requires adding a small
I'm working on a program that reads in users input as a string, which
The program i am working on creates a file (about.txt) which includes a highscore
I have a python program that I am currently working on which is working
I have a simple Delphi program that I'm working on, in which I am

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.