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

Alignment make share fix #1043

Merged
merged 2 commits into from
Feb 21, 2018
Merged

Alignment make share fix #1043

merged 2 commits into from
Feb 21, 2018

Conversation

bstastnyleapmotion
Copy link
Contributor

@wmisha
Copy link
Contributor

wmisha commented Jan 26, 2018

Nice fix, @bstastnyleapmotion. Obviously not a showstopper, but does using new here instead of make_shared cause an extra copy to happen? I recall we had a similar tradeoff to make between push_back and emplace_back.

@bstastnyleapmotion
Copy link
Contributor Author

Yeah it has an extra copy but the compiler should optimize it to minimize the cost. (hopefully)

@jdonald
Copy link
Contributor

jdonald commented Jan 27, 2018

Bummer given Autowiring doesn't have the best record on getting these things right with performance. Let's have @gittyupagain advise on this as well.

@jdonald jdonald requested a review from gittyupagain January 27, 2018 02:53
Copy link
Contributor

@yeswalrus yeswalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're talking about copy on construction cost, I'm fairly certain that this has the same number of copies as before. You could use brace initialization if you're concerned about it though.

@wmisha wmisha merged commit 7025758 into master Feb 21, 2018
@wmisha wmisha deleted the alignment-make-share-fix branch February 21, 2018 21:59
@wmisha
Copy link
Contributor

wmisha commented Feb 21, 2018

@gittyupagain profiled and didn't find any noticeable increase in running time. Correct me if I'm wrong but it seems that changing to brace initialization would only have stylistic effect.

As for why we didn't encounter the crash before, I believe this was just due to not directly using any Eigen members as autofilter types before:

Jimmy He [16:52]
It's possible these tests do fail sporadically in 32-bit if they have Eigen members.

James Donald [17:01]
It just doesn't match what I've seen in all the longstanding test failures though.
I suspect this will be clearer once we can run valgrind on that branch.

Jimmy He [17:20]
Agreed on valgrind. It's also worth noting that "if they have Eigen members" is a big if, since most of our Eigen-related outputs are vectors of objects that contain Eigen members. They don't contain them directly. And so the Eigen::aligned_allocator gets invoked.

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

Successfully merging this pull request may close these issues.

4 participants