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

Some additional Eigen porting #432

Closed
wants to merge 7 commits into from
Closed

Conversation

rpavlik
Copy link
Contributor

@rpavlik rpavlik commented May 23, 2019

Just putting this out there instead of letting it fester, totally understand if you aren't interested in it. I originally made this to attack some of the biggest time-sinks in profiling some pathological cases. In my testing now, it is about equal to 10% faster than master when running the test suite in relwithdebinfo mode. The downside of the Eigen magic is that a pure debug build is slower (4 seconds instead of 3).

There's more use of Eigen stuff that could be done, this was just what I had. Let me know if there's any interest so I can stop forward-porting it if it's not useful :D (I haven't had to use those pathological files in a while anyway, so the itch is not as strong.)

@whitequark
Copy link
Contributor

Have you seen @Evil-Spirit's Eigen port in #225? I was planning to merge that today, actually...

@whitequark
Copy link
Contributor

Regardless of anything else, you really shouldn't drop the entire source of Eigen right into this repository. Use https://github.com/eigenteam/eigen-git-mirror as a submodule.

@rpavlik
Copy link
Contributor Author

rpavlik commented May 23, 2019

oops, no, I hadn't... Yeah, my bad on the dropping the source in. Not sure why I did that last year. When I went through and fixed it, it was just easier to drop a new one instead of adding the submodule.

@rpavlik
Copy link
Contributor Author

rpavlik commented Dec 9, 2019

Rebased this (along with fixing the extlib thing, now using a submodule). Looked at the stuff by evil-spirit, looks cool, but don't have the understanding of the solver innards to safely rebase it without breaking things.

@phkahler
Copy link
Member

@rpavlik could you have a look at PR #721 ? I know he did a more extensive update and had lengthy discussion with JW about it, but adding new dependencies without breaking CI is currently way outside my territory.

@rpavlik
Copy link
Contributor Author

rpavlik commented Oct 30, 2020

So I shall look into this eventually, but I definitely wouldn't block 3.0 on it.

@phkahler
Copy link
Member

@rpavlik No problem, 3.0 is imminent. Soon after that I'll probably try to merge the evil spirit solver improvements that don't involve Eigen and then there will be plenty of time for the rest. BTW I wanted to email you but can't find contact info. Feel free to ping me - same ID at g mail.

@rpavlik
Copy link
Contributor Author

rpavlik commented Dec 22, 2021

OK, updated this.

@vespakoen
Copy link
Contributor

I honestly don't know enough about the solver to give any helpful feedback.
All I know is that I also run into the limitations of the solver quite quickly (even on a M1 Pro) and for that reason think it is a great idea to bring in Eigen and it's benefits.

I am hoping this can be combined with Evil-Spirit's changes, but am afraid this will make the merge of those changes harder? (I didn't try or look at it extensively though)

I'll probably give a stab at combining the 2 Eigen PR's soon.

@ruevs
Copy link
Member

ruevs commented Dec 23, 2021

I'll probably give a stab at combining the 2 Eigen PR's soon.

@vespakoen don't.

@rpavlik did already! #386 (comment)

Better review his.

@rpavlik rpavlik changed the title Eigen Some additional Eigen porting Jan 2, 2022
@rpavlik
Copy link
Contributor Author

rpavlik commented Jan 2, 2022

OK, I have updated this to contain the un-merged commits. These are all pretty simple replacements, I think most of these profiled as a "problem" back in the day when I did them.

@rpavlik
Copy link
Contributor Author

rpavlik commented Jan 8, 2022

OK, so using the benchmark tool (nice! I don't remember that being there previously) and a "normal" model for me, this reduces the time to load from 0.185s to 0.165s. We did def. pick up a regression, probably in that openmp jacobian, since previous master here gave me 0.161, but I'm bisecting now.

@rpavlik
Copy link
Contributor Author

rpavlik commented Jan 8, 2022

ok, now I can't repro the 0.185. Trying a release openmp build now...

@rpavlik
Copy link
Contributor Author

rpavlik commented Jan 8, 2022

Yeah I should just not do performance testing on a laptop on battery I guess.

Rebased on top of #1183 to avoid that regression.

Anyway, I think these are at least performance neutral compared to #1183 as far as I can tell, possibly a performance improvement. They were a performance improvement back in pre-3.0, but even if they're just a readability improvement: Eigen allows pretty clear, concise expressions which is lovely.

@rpavlik rpavlik requested a review from ruevs January 8, 2022 15:19
@phkahler
Copy link
Member

phkahler commented Jan 8, 2022

@rpavlik a while back, @ruevs made changes to our vector class adding C++ 11 style return { ... } to the methods. That was a solid win in performance. I'm not in favor of adding Eigen functions in place of ours unless there is a clear advantage. OTOH the faster this gets, the more significant each improvement gets! So I guess I'm saying to retest for performance wins when adding Eigen functions.

@rpavlik
Copy link
Contributor Author

rpavlik commented Jan 9, 2022

I don't have data for these anymore, but they made a visible interactive improvement while editing as well as a profiling improvement back when I wrote these in 2016. Since then I've changed jobs, had another kid, done many other things, and rebased this countless times, so I no longer have that data. But I clearly remember both the min altitude and tangents at being big bottlenecks at that time. I imagine I was using tangent arcs (fillets) which were not used in my test model yesterday because the whole thing was round and because I basically learned they don't work well in stock Solvespace. If you don't want to merge these that's fine, but please close this pr then so I stop spending time rebasing it and trying to submit it for review and integration, I'll just carry it on a local tree.

@ruevs ruevs mentioned this pull request Jan 9, 2022
@phkahler
Copy link
Member

I'll close it then. I believe there is more improvement in ratpoly to be had without introducing a new API.

@phkahler phkahler closed this Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants