8000 added MANIFOLD_ASSERT by elalish · Pull Request #1225 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

added MANIFOLD_ASSERT #1225

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

Merged
merged 5 commits into from
Apr 12, 2025
Merged

added MANIFOLD_ASSERT #1225

merged 5 commits into from
Apr 12, 2025

Conversation

elalish
Copy link
Owner
@elalish elalish commented Apr 11, 2025

Fixes #1224

We incur about a 20% overhead for enabling assertions, which MANIFOLD_DEBUG did. Here I've added MANIFOLD_ASSERT to control that explicitly. MANIFOLD_DEBUG controls the inclusion of all string and stream related headers, and I've now centralized those includes.

@elalish elalish self-assigned this Apr 11, 2025
#include <iostream>
#include <string>
#endif

Copy link
Contributor

Choose a reason for hiding this comment

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

Just a thought - should we be hiding the ReadOBJ/WriteOBJ methods behind an #ifdef MANIFOLD_DEBUG as well, since they use std::istream and std::ostream?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, nevermind - I'll fix that myself in a separate PR - should be orthogonal to this.

Copy link
codecov bot commented Apr 12, 2025

Codecov Report

Attention: Patch coverage is 93.97590% with 5 lines in your changes missing coverage. Please review.

Project coverage is 92.19%. Comparing base (b8dd573) to head (260f2e3).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/boolean_result.cpp 92.30% 2 Missing ⚠️
src/polygon.cpp 88.23% 2 Missing ⚠️
src/vec.h 92.30% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1225   +/-   ##
=======================================
  Coverage   92.19%   92.19%           
=======================================
  Files          31       31           
  Lines        5985     5987    +2     
=======================================
+ Hits         5518     5520    +2     
  Misses        467      467           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@@ -37,6 +37,7 @@ set(
# Primary user facing options
option(MANIFOLD_CROSS_SECTION "Build CrossSection for 2D support" ON)
option(MANIFOLD_DEBUG "Enable debug tracing/timing" OFF)
option(MANIFOLD_ASSERT "Enable assertions - requires MANIFOLD_DEBUG" OFF)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I remember there is a fancy dependent option thing that may be useful here. At least we may want to issue an error if the user only enabled MANIFOLD_ASSERT without enabling MANIFOLD_DEBUG?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good idea - want to throw that into a follow-up PR?

@@ -1 +1,4 @@
BasedOnStyle: Google
PointerAlignment: Left
ReferenceAlignment: Left
DerivePointerAlignment: false
Copy link
Owner Author

Choose a reason for hiding this comment

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

I got tired of clang-format going back and forth on things between versions, and I think this'll help. I had to reformat the whole code base because apparently it was not being consistent about where the & was.

@elalish elalish merged commit 09fb03c into master Apr 12, 2025
27 checks passed
@elalish elalish deleted the debugCleanup branch April 12, 2025 09:18
@elalish elalish mentioned this pull request May 14, 2025
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.

MANIFOLD_DEBUG performance implications
3 participants
0