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

Change from Emitter to TinyEmitter to save MB #975

Closed
samreid opened this issue May 17, 2019 · 6 comments
Closed

Change from Emitter to TinyEmitter to save MB #975

samreid opened this issue May 17, 2019 · 6 comments
Assignees

Comments

@samreid
Copy link
Member

samreid commented May 17, 2019

It seems wave interference can save around 2MB on the heap by converting Color.changeEmitter from Emitter to TinyEmitter.

image

It seems the only usage of this is in SVGGradientStop, and it is not using any Emitter-specific features. So I'll go ahead with this.

@samreid samreid self-assigned this May 17, 2019
@samreid
Copy link
Member Author

samreid commented May 17, 2019

See also phetsims/wave-interference#399

@samreid
Copy link
Member Author

samreid commented May 17, 2019

Likewise, this change saves around 0.7MB in Beer's Law Lab:

image

@samreid
Copy link
Member Author

samreid commented May 17, 2019

Tested and pushed. Would be good for @jonathanolson to review--may be a quick one to consider and sign off.

@samreid samreid assigned jonathanolson and unassigned samreid May 17, 2019
@samreid samreid changed the title Change Color.changeEmitter from Emitter to TinyEmitter Change from Emitter to TinyEmitter to save MB May 17, 2019
@samreid
Copy link
Member Author

samreid commented May 17, 2019

I just saved another 2MB by making the same change for Fittability.subtreeFittabilityChange. I'll commit here.

@jonathanolson
Copy link
Contributor

Both of these look great! I'm going to assign myself to look for any more cases where this could be used. Thanks.

@jonathanolson
Copy link
Contributor

Handled all the cases that seemed relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants