Skip to content

Micro size optimizations#108

Open
bcolucci wants to merge 1 commit intojaredreich:masterfrom
bcolucci:micro-size-opti
Open

Micro size optimizations#108
bcolucci wants to merge 1 commit intojaredreich:masterfrom
bcolucci:micro-size-opti

Conversation

@bcolucci
Copy link
Copy Markdown

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

@jaredreich
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
Author

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

@bcolucci
Copy link
Copy Markdown
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