Skip to content

perf(lambda-rs): Avoid cloning vertices and attributes when building meshes#190

Merged
vmarcella merged 1 commit intomainfrom
vmarcella/avoid-cloning-vertices
Mar 6, 2026
Merged

perf(lambda-rs): Avoid cloning vertices and attributes when building meshes#190
vmarcella merged 1 commit intomainfrom
vmarcella/avoid-cloning-vertices

Conversation

@vmarcella
Copy link
Member

Summary

Refactors MeshBuilder to use by-value chaining and makes build(self) consume the builder, eliminating O(n) clones of vertex/attribute buffers during mesh finalization.

Related Issues

  • N/A

Changes

  • Updated MeshBuilder builder methods to take/return Self (with_capacity, with_vertex, with_attributes) and changed build to build(self) -> Mesh.
  • Updated call sites (demos + lambda-obj-loader) to use by-value chaining / folds.
  • Updated docs/tutorial snippets.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (updates to docs, specs, tutorials, or comments)
  • Refactor (code change that neither fixes a bug nor adds a feature)
  • Performance (change that improves performance)
  • Test (adding or updating tests)
  • Build/CI (changes to build process or CI configuration)

Affected Crates

  • lambda-rs
  • lambda-rs-platform
  • lambda-rs-args
  • lambda-rs-logging
  • Other: lambda-demos-render, lambda-demos-physics, lambda-obj-loader, docs

Checklist

  • Code follows the repository style guidelines (cargo +nightly fmt --all) (not run)
  • Code passes clippy (cargo clippy --workspace --all-targets -- -D warnings) (not run)
  • Tests pass (cargo test --workspace) (not run)
  • New code includes appropriate documentation
  • Public API changes are documented
  • Breaking changes are noted in this PR description

Testing

Commands run:

cargo test -p lambda-rs
cargo check -p lambda-demos-render -p lambda-demos-physics -p lambda-obj-loader

Manual verification steps (if applicable):

  1. N/A

Screenshots/Recordings

N/A

Platform Testing

  • macOS
  • Windows
  • Linux

Additional Notes

@github-actions
Copy link

github-actions bot commented Mar 6, 2026

✅ Coverage Report

📊 View Full HTML Report (download artifact)

Overall Coverage

Metric Value
Total Line Coverage 76.73%
Lines Covered 12529 / 16329

Changed Files in This PR

File Coverage Lines
crates/lambda-rs-args/src/lib.rs 75.35% 743/986
crates/lambda-rs/src/render/mesh.rs 94.17% 113/120

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: 84d86f7

@vmarcella vmarcella merged commit 5b362a0 into main Mar 6, 2026
10 checks passed
@vmarcella vmarcella deleted the vmarcella/avoid-cloning-vertices branch March 6, 2026 06:16
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.

1 participant