Conversation
lpatiny
commented
Feb 18, 2026
- test: add simple benchmark
- chore: ignore CPU. files
- feat: allow inplace reimFFT
| import type { DataReIm } from '../types/index.ts'; | ||
| import { xRotate } from '../x/index.ts'; | ||
|
|
||
| let output: Float64Array | undefined; |
There was a problem hiding this comment.
@targos those arrays are recreated each time we call this method which consume some memory especially on 2D for which we call this method maybe 256 times with the same size.
Is it acceptable to define them globally the code being sync ?
There was a problem hiding this comment.
Not really a fan. This will keep the last used objects indefinitely in memory.
I would rather export a function that creates an object with these arrays, and accept that object as an option.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
=======================================
Coverage 96.88% 96.89%
=======================================
Files 190 190
Lines 3601 3607 +6
Branches 910 915 +5
=======================================
+ Hits 3489 3495 +6
Misses 108 108
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
||
| let output: Float64Array | undefined; | ||
| let complexArray: Float64Array | undefined; | ||
| let fft: FFT | undefined; |
There was a problem hiding this comment.
I also cache the FFT instance and I think it is ok. With this I can win a factor 2 in my benchmark reimFFT (3000 to 6800 iterations in 5s)
|
Keeping a pointer to a large object is not a good idea. In order to optimize we will create a new method reimArrayFFT |