Skip to content

Investigate Vector dot and norm2_sq performance #155

@acgetchell

Description

@acgetchell

Summary

Track follow-up performance work for Vector::dot and Vector::norm2_sq / squared norm in v0.4.4.

Recent vs_linalg benchmark results suggest these vector kernels are significantly slower than comparable nalgebra and faer rows, unlike the stronger LDLT/Cholesky solve signal. This should be investigated separately from Matrix::inf_norm so each kernel can be profiled, changed, and reviewed independently.

Current State

  • bench-vs-linalg includes comparable dot and norm2_sq rows across D=2-64.
  • The current implementation appears to lag nalgebra/faer in those rows.
  • Local saved-baseline workflows are documented in docs/BENCHMARKING.md for tight optimization loops.

Proposed Changes

  • Re-run focused vs_linalg measurements for dot and norm2_sq.
  • Profile the current implementations and identify whether the gap is loop shape, bounds checks, missed vectorization/FMA, Criterion setup, or another effect.
  • Consider allocation-free and const-generic-friendly implementation changes that preserve the public API and numerical behavior.
  • Add or adjust focused benchmarks/tests only where they improve confidence.

Benefits

  • Improves small fixed-dimension vector-kernel performance.
  • Keeps v0.4.4 performance work scoped alongside the inf_norm investigation.
  • Makes README and release performance claims easier to reason about.

Implementation Notes

  • Related: Investigate Matrix::inf_norm performance #154
  • Use just performance-local-vs-linalg <current-tag> <baseline-tag> for release-signal checks.
  • Use just bench-save-baseline <name> vs_linalg, just bench-vs-linalg-la-stack, and just bench-compare <name> vs_linalg all-benches for local iteration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance related issuesrustPull requests that update rust code

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions