Skip to content

Conversation

@chiefcll
Copy link
Contributor

Added Memize library to add a layer of caching for timing functions and Dynamic shader.

Optimized shader to return same default object which allows memize to use the object as a key efficiently. Thus most effects reuse the same props results.

);

// If all the colors are the same just sent them all to the same value
if (
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit surprised this would have much of an impact as these colors, unless they are changed, should only be calculated once for the node and never again during the life cycle of the node. Is it like an on-going FPS drop or just like an initial page load drop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

99% of nodes are a single color - then passed to the render its split into the four props - and then the alpha color is calculated 4 times per node.

Also these are recalculated a lot as alpha fade in out is one of the biggest animations - and I assume that gets recalculated with a new alpha value

'colorTr',
'colorBl',
'colorBr',
];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The biggest culprit here was probably reinitializing this array rather than storing it as a const at the top of the file.

Copy link
Contributor

@frank-weindel frank-weindel left a comment

Choose a reason for hiding this comment

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

With all checks passing this LGTM

@frank-weindel frank-weindel added this pull request to the merge queue Jan 25, 2024
Merged via the queue into main with commit 1971c91 Jan 25, 2024
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