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

Micro size optimizations #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bcolucci
Copy link

With these little optimizations, we save about 13% of the initial size (3544 b to 3087).

@jaredreich
Copy link
Owner

jaredreich commented Mar 20, 2018

@bcolucci thanks, lots of good stuff here. Only thing is the shortcuts for the window methods (e.g. addEventListener) do actually decrease the minified file size, especially when they are used more than once. It's because then the file only has to have a reference to a method name like addEventListener, then the variable referencing it can be something like a = .... Other than that, I'll implement some of these changes, thanks!

@ramlmn
Copy link

ramlmn commented Mar 20, 2018

Only thing is the shortcuts for the window methods (e.g. addEventListener) do actually decrease the minified file size, especially when they are used more than once. It's because then the file only has to have a reference to a method name like addEventListener, then the variable referencing it can be something like a = ....

That depends on the features added to the library in the future. For now, this PR looks great!

@bcolucci
Copy link
Author

Could also be great to merge the testing environment PR, so we will be able to test ;)

@bcolucci
Copy link
Author

bcolucci commented Mar 21, 2018

@jaredreich I've reduced the actual code. But yeah, of course, if you use more (in next release) these shortcuts it's better to have them declared as you said.

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

Successfully merging this pull request may close these issues.

3 participants