Skip to content

Remove memory allocation for interpolateColors following FIXME comment #1077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ImmortalRabbit
Copy link
Contributor

Remove memory allocation for interpolateColors following FIXME comment

@lukasmasuch lukasmasuch requested a review from Copilot August 8, 2025 22:59
Copilot

This comment was marked as outdated.

@lukasmasuch lukasmasuch requested a review from Copilot August 14, 2025 11:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses a performance optimization by removing unnecessary memory allocation in the interpolateColors function. The change follows a FIXME comment that suggested avoiding array creation for better performance.

  • Replaces array spread operations with direct variable destructuring
  • Eliminates temporary array allocations for pre-multiplied alpha calculations
  • Maintains the same functional behavior while improving memory efficiency
Comments suppressed due to low confidence (1)

packages/core/src/internal/data-grid/color-parser.ts:101

  • The word 'makign' should be 'making' in the removed FIXME comment.
    const [lr, lg, lb, la] = parseToRgba(leftColor);

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

sfc-gh-lmasuch
sfc-gh-lmasuch approved these changes Aug 14, 2025
Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@lukasmasuch lukasmasuch merged commit 6143a3c into glideapps:main Aug 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants