Refactor number[] to Float32Array/Float64Array for performance#3
Open
Copilot wants to merge 8 commits into
Open
Refactor number[] to Float32Array/Float64Array for performance#3Copilot wants to merge 8 commits into
Copilot wants to merge 8 commits into
Conversation
4 tasks
- Refactor xPrev, dxPrev, and filter I/O from number[] to Float32Array - Update type declarations to reflect new signatures - Update example and README to document Float32Array usage - Rebuild dist files
Copilot
AI
changed the title
[WIP] Refactor number[] to Float32Array for performance improvement
Refactor number[] to Float32Array for performance improvement
May 26, 2026
- Introduce FilterDataArray union type (Float32Array | Float64Array) - Make filter() generic so output type matches input type - Add createTypedArray helper to dynamically construct matching arrays - Export FilterDataArray type from index - Update type declarations, README, and rebuild dist
Copilot
AI
changed the title
Refactor number[] to Float32Array for performance improvement
Refactor number[] to Float32Array/Float64Array for performance
May 26, 2026
c8afafd to
dd2e563
Compare
…/github.com/webarkit/OneEuroFilter-ts into copilot/refactor-number-array-to-typedarray # Conflicts: # .github/workflows/ci.yml
…es/src folder (addresses #4)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace all
number[]vector types with typed arrays (Float32Array/Float64Array) for better memory layout, computation efficiency, and typed array API compatibility.Changes
FilterDataArrayunion type —Float32Array | Float64Array, exported for consumer usefilter<T>()— return type matches input type via genericscreateTypedArrayhelper — dynamically constructs the correct typed array type from the input, used for all internal buffer allocationxPrev/dxPrev— changed fromnumber[] | nulltoFilterDataArray | null; initialization now copies input via typed array constructor instead of aliasingtypes/OneEuroFilter.d.tsandtypes/src/OneEuroFilter.d.tsnew Float32Array([...])Usage