Skip to content
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

[Performance] Massive fps drop when creating large rectangels #24

Closed
sandstone991 opened this issue May 14, 2023 · 2 comments · Fixed by #27
Closed

[Performance] Massive fps drop when creating large rectangels #24

sandstone991 opened this issue May 14, 2023 · 2 comments · Fixed by #27
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed p0-high Priority High

Comments

@sandstone991
Copy link
Member

Describe the problem
Somehow, somewhy creating large rectangles causes the fps to drop dramatically, creating many small ones on the other hand doesn't seem to be a problem, I have no idea why this is the case.

@sandstone991 sandstone991 added bug Something isn't working help wanted Extra attention is needed p0-high Priority High labels May 14, 2023
@sandstone991
Copy link
Member Author

I think part of the issue is we're using rough.draw() to draw the shape every frame instead of caching the shape on an off canvas.
more investigating has to be done though

@sandstone991
Copy link
Member Author

Caching really did wonders on that one, basically what I've done is assigned an off-screen canvas to each expensive element like (rectangles, hand-drawn elements), I draw on that off-screen canvas once and then every frame I just draw an image of that canvas onto the canvas that's actually shown to the user, this has proven to really boost performance.

@sandstone991 sandstone991 linked a pull request Jun 3, 2023 that will close this issue
sandstone991 added a commit that referenced this issue Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed p0-high Priority High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant