fix: fix CPU issue in dot animations#42
Merged
Merged
Conversation
Skip drawing dots with zero progress, replace roundRect with fillRect to eliminate complex path rasterization, and drop devicePixelRatio scaling to avoid allocating an oversized canvas texture on Retina displays.
wellwelwel
requested changes
May 6, 2026
Member
wellwelwel
left a comment
There was a problem hiding this comment.
Testei localmente, mas mudou muito o esquema da animação para algo mais engessado de certa forma. Sobre pular os que não estão visíveis, a ideia é legal, mas é típico da IA mexer em mais coisas do que precisa. Acredito que a mudança de cálculo com a remoção do arredondamento fez a animação apenas "mostrar" vs. "não mostrar" ao invés de ter uma suavidade, mesmo que discreta.
Em termos artísticos, eu diria que essa mudança da IA tirou totalmente a alma da animação, mesmo que pareça bastante com a ideia original.
Member
Author
|
Na verdade eu testei só com a remoção da visibilidade e o problema continuou. O que resolveu foi remover o cálculo de pixel resolution mesmo |
khaosdoctor
added a commit
that referenced
this pull request
May 10, 2026
This reverts commit ac6ba1d.
khaosdoctor
added a commit
that referenced
this pull request
May 11, 2026
This reverts commit ac6ba1d.
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.
Problem: The Brazil flag dot canvas was causing high GPU usage (59%+) and page-wide hangs due to three issues in canvas.ts:
Changes: Skip invisible dots before drawing, replace roundRect with fillRect, and remove the devicePixelRatio multiplier from canvas sizing.