Skip to content

Add benchmarking for refinement method and reduce allocations#213

Merged
1-Bart-1 merged 14 commits intomainfrom
refinement-bench
Apr 14, 2026
Merged

Add benchmarking for refinement method and reduce allocations#213
1-Bart-1 merged 14 commits intomainfrom
refinement-bench

Conversation

@1-Bart-1
Copy link
Copy Markdown
Member

@1-Bart-1 1-Bart-1 commented Apr 6, 2026

No description provided.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 94.73684% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/wing_geometry.jl 94.73% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

@1-Bart-1 1-Bart-1 marked this pull request as ready for review April 11, 2026 09:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds allocation-focused benchmarks and tests around wing mesh refinement, while refactoring refinement and billowing internals to reduce heap allocations (primarily by avoiding temporary matrices/vectors and using scalar/SVector arithmetic).

Changes:

  • Refactors refine! helpers to reduce allocations (skip unnecessary sorting, remove LE/TE matrix extraction, scalar center-distance math, zero-copy aero interpolation).
  • Reworks billowing utilities to avoid MVec3 temporaries by introducing rotated_te and using scalar/SVector arithmetic in billowing_arc_length and apply_billowing_to_pair!.
  • Adds new correctness tests for UNCHANGED, COSINE, and SPLIT_PROVIDED refinement behavior, plus new allocation benchmarks for refinement and billowing helpers.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/wing_geometry.jl Refines section sorting, mapping computation, aero interpolation, linear/cosine refinement, and billowing math to reduce allocations.
test/bench.jl Adds allocation benchmarks for refine!, billowing_arc_length, and apply_billowing_to_pair!.
test/wing_geometry/test_wing_geometry.jl Adds refinement correctness tests for UNCHANGED, COSINE, and SPLIT_PROVIDED.
test/wing_geometry/test_billowing.jl Updates tests to use the new rotated_te helper instead of rodrigues_rotate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/wing_geometry.jl Outdated
Comment thread src/wing_geometry.jl
Comment thread src/wing_geometry.jl Outdated
Copy link
Copy Markdown
Member

@ufechner7 ufechner7 left a comment

Choose a reason for hiding this comment

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

Be careful with @inbounds!

@1-Bart-1 1-Bart-1 merged commit 6f45eb2 into main Apr 14, 2026
9 checks passed
@1-Bart-1 1-Bart-1 deleted the refinement-bench branch April 14, 2026 16:19
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.

3 participants