perf(lambda-rs): Avoid cloning vertices and attributes when building meshes#190
Merged
perf(lambda-rs): Avoid cloning vertices and attributes when building meshes#190
Conversation
… which can get expensive for larger meshes
✅ Coverage Report📊 View Full HTML Report (download artifact) Overall Coverage
Changed Files in This PR
PR Files Coverage: 77.39% (856/1106 lines) Generated by cargo-llvm-cov · Latest main coverage Last updated: 2026-03-06 04:10:52 UTC · Commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors
MeshBuilderto use by-value chaining and makesbuild(self)consume the builder, eliminating O(n) clones of vertex/attribute buffers during mesh finalization.Related Issues
Changes
MeshBuilderbuilder methods to take/returnSelf(with_capacity,with_vertex,with_attributes) and changedbuildtobuild(self) -> Mesh.lambda-obj-loader) to use by-value chaining / folds.Type of Change
Affected Crates
lambda-rslambda-rs-platformlambda-rs-argslambda-rs-logginglambda-demos-render,lambda-demos-physics,lambda-obj-loader, docsChecklist
cargo +nightly fmt --all) (not run)cargo clippy --workspace --all-targets -- -D warnings) (not run)cargo test --workspace) (not run)Testing
Commands run:
cargo test -p lambda-rs cargo check -p lambda-demos-render -p lambda-demos-physics -p lambda-obj-loaderManual verification steps (if applicable):
Screenshots/Recordings
N/A
Platform Testing
Additional Notes