Skip to content
New issue

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

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

Already on GitHub? # to your account

optimize triangulator for msvc #722

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

pca006132
Copy link
Collaborator

It seems that msvc does not optimize glm::determinant(glm::mat2(a, b)) well, it requires an intermediate struct that is stored in the stack, causing performance issues. This patch improves the performance of the test in #718 from 5s to 2s on Windows, and no performance degradation with clang/gcc.

@briansturgill maybe you can test this as well, I am using a windows vm so the performance number may not be that accurate.

Copy link

codecov bot commented Jan 28, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0b7ee87) 91.67% compared to head (617d60d) 91.65%.

Files Patch % Lines
src/polygon/src/polygon.cpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #722      +/-   ##
==========================================
- Coverage   91.67%   91.65%   -0.02%     
==========================================
  Files          37       37              
  Lines        4732     4734       +2     
==========================================
+ Hits         4338     4339       +1     
- Misses        394      395       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@briansturgill
Copy link
Contributor

@pca006132 You want just Windows, or Windows and Mac.

@pca006132
Copy link
Collaborator Author

@briansturgill just windows is fine

@briansturgill
Copy link
Contributor

@pca006132 Good news... several runs, results in range 1500-1600 over 4x performance boost.

@pca006132
Copy link
Collaborator Author

Nice! Thanks a lot. Btw feel free to open discussions if you find other potential performance issues, even if they are platform specific. Tracy is a useful tool to find such issues.

@pca006132 pca006132 merged commit 1635864 into elalish:master Jan 29, 2024
18 checks passed
@pca006132 pca006132 deleted the triangulator-perf branch January 29, 2024 04:31
@elalish
Copy link
Owner

elalish commented Jan 29, 2024

Good find!

cartesian-theatrics pushed a commit to SovereignShop/manifold that referenced this pull request Mar 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants