Skip to content

Commit d0b5c52

Browse files
committed
perf: optimize SIMD loops with unsafe indexing
Replace slice-based access (base[i:i+lanes]) with unsafeIndexVec to eliminate runtime.panicBounds checks in critical SIMD loops. Changes: - Replace unsafeSliceInt8/16/32/64 and unsafeSliceUint* with unsafeIndexVec - Add unsafeIndexBase and unsafeIndexOffset for optimal performance - Update Sum*, Mean*, Min*, Max*, Contains*, Clamp* functions - Remove unused unsafeSlice* helper functions Generated code size: ~96 bytes / ~12 instructions less per function Better cache locality without slice header overhead
1 parent 14fff24 commit d0b5c52

5 files changed

Lines changed: 177 additions & 480 deletions

File tree

0 commit comments

Comments
 (0)