ejmahler / RustFFT

RustFFT is a high-performance FFT library written in pure Rust.
Apache License 2.0
707 stars 49 forks source link

Using &mut [MaybeUnInit<Complex<T>>] for output and scratch #79

Closed RamType0 closed 2 years ago

RamType0 commented 3 years ago

Because the initial value of these would not affect the result , we could use &mut [MaybeUnInit<Complex<T>>] instead of &mut [Complex<T>].

ejmahler commented 2 years ago

I think I have to say no to this, unfortunately.

Forcing all users to do this would be a large ergonomics burden on users, and adding it as an alternative API would require a very large amount of boilerplate that would be too large to maintain and document.

I appreciate the suggestion though!

WalterSmuts commented 1 year ago

@RamType0, what was your motivation for suggesting this?

RamType0 commented 1 year ago

@RamType0, what was your motivation for suggesting this?

Zero initializing output and scratch before we pass them to this function is unnecessary cost.

I think using &mut [MaybeUnInit<Complex<T>>] is better for scratch at least.