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

perf(SprayBrush): enhance perf using new Group #7871

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ShaMan123
Copy link
Contributor

This PR is an excellent demonstration of the power of the new Group and what can be unlocked using it
control
perf

Basically it reduces computation cost by iterating only once over the spray dots instead of a number of times.
It split up the dots into a number of groups that act as buffers to cut down iterations.
I need to get these buffers to render cache once they're maxed out and then performance will rise even more (splitting the rendering of the entire spray into smaller chunks and then at mouseup the create path is a group of groups that have already been cached so overhead will be minimal)

Will merge once v6! stabilizes

The buffering approach can/should be used by canvas for perf

If we wrap the result of the spray brush with another group we enhance perf even more in case it is used with clip path or in other cases that invalidate cache.

In action

You'll see that the dots double every second or so. That's the buffering group.
Notice that normally there is a massive frame drop on mouse up and here, even though the spray is huge there is no visible drop.

Zoom in on mouse up

spray1.mp4

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.81 |    75.23 |   86.15 |   82.48 |                                               
 fabric.js |   82.81 |    75.23 |   86.15 |   82.48 | ...,30497,30571,30582-30647,30770,30869,31105 
-----------|---------|----------|---------|---------|-----------------------------------------------

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.81 |    75.23 |   86.15 |   82.48 |                                               
 fabric.js |   82.81 |    75.23 |   86.15 |   82.48 | ...,30497,30571,30582-30647,30770,30869,31105 
-----------|---------|----------|---------|---------|-----------------------------------------------

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |    82.8 |    75.19 |   86.15 |   82.47 |                                               
 fabric.js |    82.8 |    75.19 |   86.15 |   82.47 | ...,30497,30571,30582-30647,30770,30869,31105 
-----------|---------|----------|---------|---------|-----------------------------------------------

@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Apr 25, 2022
@ShaMan123 ShaMan123 added v6 and removed stale Issue marked as stale by the stale bot labels Apr 25, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 1, 2022

Code Coverage Summary

> fabric@5.1.0 coverage:report
> nyc report --reporter=lcov --reporter=text

-----------|---------|----------|---------|---------|-----------------------------------------------
File       | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                             
-----------|---------|----------|---------|---------|-----------------------------------------------
All files  |   82.96 |    75.84 |   85.59 |   82.65 |                                               
 fabric.js |   82.96 |    75.84 |   85.59 |   82.65 | ...,30880,30954,30965-31030,31153,31252,31488 
-----------|---------|----------|---------|---------|-----------------------------------------------

@stale
Copy link

stale bot commented Jun 12, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Jun 12, 2022
@ShaMan123 ShaMan123 removed the stale Issue marked as stale by the stale bot label Jun 13, 2022
@stale
Copy link

stale bot commented Jun 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Jun 28, 2022
@ShaMan123 ShaMan123 removed the stale Issue marked as stale by the stale bot label Jun 28, 2022
@stale
Copy link

stale bot commented Jul 30, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Jul 30, 2022
@ShaMan123 ShaMan123 removed the stale Issue marked as stale by the stale bot label Aug 1, 2022
@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Issue marked as stale by the stale bot label Sep 21, 2022
@ShaMan123 ShaMan123 removed the stale Issue marked as stale by the stale bot label Sep 21, 2022
@ShaMan123 ShaMan123 added low_priority stale Issue marked as stale by the stale bot and removed v6 labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low_priority stale Issue marked as stale by the stale bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant