Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise objects to decrease their sizes #2050

Open
375gnu opened this issue Dec 31, 2023 · 1 comment
Open

Revise objects to decrease their sizes #2050

375gnu opened this issue Dec 31, 2023 · 1 comment

Comments

@375gnu
Copy link
Member

375gnu commented Dec 31, 2023

If we reorder fields we can decrease memory usage because now a lot of memory is wasted by paddings.

@ajtribick
Copy link
Collaborator

ajtribick commented Dec 31, 2023

I would also like to investigate whether or not it makes sense to split the DSO representation into the octree-relevant vs other details details, rather than having an inheritance hierarchy in DSO, along the lines of:

class DeepSkyObject
{
    Eigen::Vector3d position;
    float radius;
    float absMag;
    std::variant<std::unique_ptr<Galaxy>, std::unique_ptr<Globular>, ...> details;
}

(although we would probably want to implement the variant manually, since the std::variant will necessarily introduce padding between the discriminant and the pointer)

Would likely help with locality when walking the octree (could store the DeepSkyObject directly in the octree structure rather than adding indirection)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants