Comfy-Org / Comfy-Org/ComfyUI_frontend
Optimize monotone interpolator by precomputing segment constants
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 702
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 512
Description
## Context
A performance optimization opportunity was identified in the `createMonotoneInterpolator` function added in PR #8860.
## Suggestion
Precompute per-segment data (dx, m0dx, m1dx) to reduce the number of array reads and multiplications during interpolation evaluation. This would cache segment-level constants once during setup rather than recomputing them on every evaluation call.
## References
- PR: #8860
- Original suggestion: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8860#discussion_r2838858980
- Suggested by: @christian-byrne
## File
`src/components/curve/curveUtils.ts`
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9111-Optimize-monotone-interpolator-by-precomputing-segment-constants-3106d73d3650818c95eecee3f3584a0e) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.