-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Further improve bundle size #50
Comments
We should definitely do this. As a starting point, helpers like |
cloneNode could be helpful here, too. |
Was about to suggest the similar optimization. Plucking methods like |
Yup. I did a little test locally yesterday, and found about a 20% savings by doing this on a relatively small project. |
BTW does it make sense to have |
@emirotin you want to avoid polymorphic functions like that, that's why Inferno avoids them in core – they result in functions that can't be properly optimised. |
Interesting @trueadm thanks for the insight. |
Helpers have been in Svelte for a while, is this issue open for other helpers? Like the suggested |
Probably slightly trickier to do |
I was looking at the js-framework-benchmark output for Svelte and it got me thinking, take this:
Could you not simplify this somewhat, to be:
This is actually something the old Inferno's used to do (would compile vdom to client-side code) with t7. It would look ahead to see if there are many common patterns (like an element with a className) and build dedicated factories for them. Performance actually improved in many cases, as the function for the component was small enough when minified to be inlined by most JavaScript engines.
The text was updated successfully, but these errors were encountered: