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

Single module Natural to reduce maintenance burden #72

Closed
wants to merge 1 commit into from

Conversation

PowerKiKi
Copy link
Member

@PowerKiKi PowerKiKi commented Oct 22, 2020

A new branch single-module is also available in the mentioned projects for local testing.

OKpilot

Before

Done in 84.63s.

3228	htdocs/fr/main.32d5d8d694eb19eb7dfe.js
128	htdocs/fr/polyfills-es5.114c34b07441cae96472.js
48	htdocs/fr/polyfills.ff2b3e21e5011d1385ca.js
4	htdocs/fr/runtime.eedc576ef565e660acf6.js
3408	total

After

Done in 78.46s.

3232	htdocs/fr/main.7f7770e4a7eb14b11033.js
128	htdocs/fr/polyfills-es5.114c34b07441cae96472.js
48	htdocs/fr/polyfills.ff2b3e21e5011d1385ca.js
4	htdocs/fr/runtime.eedc576ef565e660acf6.js
3412	total

Epicerio

Before

Done in 119.82s.

60	htdocs/1-es2015.4d7939342acf7bdaebc0.js
64	htdocs/1-es5.4d7939342acf7bdaebc0.js
724	htdocs/6-es2015.dbf3a970aa46026ef26c.js
732	htdocs/6-es5.dbf3a970aa46026ef26c.js
28	htdocs/7-es2015.34dfba1820c88d6b15c7.js
28	htdocs/7-es5.34dfba1820c88d6b15c7.js
2212	htdocs/main-es2015.253b52046c44daecfbf2.js
2400	htdocs/main-es5.253b52046c44daecfbf2.js
140	htdocs/ngsw-worker.js
40	htdocs/polyfills-es2015.f49715384bd9a5cd9a13.js
132	htdocs/polyfills-es5.78c5319e5c7b9fff80f8.js
4	htdocs/runtime-es2015.6ef41e7b373e7efb433a.js
4	htdocs/runtime-es5.6ef41e7b373e7efb433a.js
4	htdocs/safety-worker.js
4	htdocs/worker-basic.min.js
6576	total

After

Done in 101.80s.

60	htdocs/1-es2015.c8e916f7f4a37f5923ed.js
64	htdocs/1-es5.c8e916f7f4a37f5923ed.js
724	htdocs/6-es2015.c092a4d96758764066a0.js
732	htdocs/6-es5.c092a4d96758764066a0.js
28	htdocs/7-es2015.91e991fc43f9249b239b.js
28	htdocs/7-es5.91e991fc43f9249b239b.js
2252	htdocs/main-es2015.18d7849d6e08c098a7ea.js
2448	htdocs/main-es5.18d7849d6e08c098a7ea.js
140	htdocs/ngsw-worker.js
40	htdocs/polyfills-es2015.f49715384bd9a5cd9a13.js
132	htdocs/polyfills-es5.78c5319e5c7b9fff80f8.js
4	htdocs/runtime-es2015.f90df06b2015214f1249.js
4	htdocs/runtime-es5.f90df06b2015214f1249.js
4	htdocs/safety-worker.js
4	htdocs/worker-basic.min.js
6664	total

Ecolock

Before

Done in 43.63s.

72	htdocs/5-es2015.d47f5879e587ac62434f.js
76	htdocs/5-es5.d47f5879e587ac62434f.js
12	htdocs/6-es2015.1252dd69d6fbe09f367c.js
12	htdocs/6-es5.1252dd69d6fbe09f367c.js
1468	htdocs/main-es2015.883263d173e6675900be.js
1636	htdocs/main-es5.883263d173e6675900be.js
40	htdocs/polyfills-es2015.00121073ae4602f46dae.js
132	htdocs/polyfills-es5.531777fac0f977ebbae2.js
4	htdocs/runtime-es2015.8fc00b7419f9860b3d75.js
4	htdocs/runtime-es5.8fc00b7419f9860b3d75.js
3456	total

After

Done in 70.92s.

72	htdocs/5-es2015.1d12c372bd100114d489.js
76	htdocs/5-es5.1d12c372bd100114d489.js
12	htdocs/6-es2015.96fc0a0cb187c04b476c.js
12	htdocs/6-es5.96fc0a0cb187c04b476c.js
1516	htdocs/main-es2015.a087d059c84af92742c5.js
1692	htdocs/main-es5.a087d059c84af92742c5.js
40	htdocs/polyfills-es2015.00121073ae4602f46dae.js
132	htdocs/polyfills-es5.531777fac0f977ebbae2.js
4	htdocs/runtime-es2015.ea501f7a8782ad8859b9.js
4	htdocs/runtime-es5.ea501f7a8782ad8859b9.js
3560	total

Natural

Before

Done in 19.86s.

6060	node_modules/@ecodev/natural/

After

Done in 15.04s.

5856	node_modules/@ecodev/natural/

Conclusion

All applications grew, by ~4-100kb. So 100.1% - 103.0% of original size.

Compilation time is a bit shorter for bigger application such as OKpilot and Epicerio. But small application such as Ecolock suffer a huge increase of compilation time. I assume it spend a lot of time to treeshake things that are never needed at all. So overall it's 84.9% - 162% of original time.

Less relevant but Natural itself is 96.6% of original size and 75.7% of compile time.

It is not as clear as I expected. But because bundle size is probably the most critical measure of all, and because we already have multiples modules, I'd tend to not change anything.

WDTY ?

@stissot
Copy link
Member

stissot commented Oct 22, 2020

Thanks for the measurements.

The overall performance and size improvements are not big enough to really justify the refactor into a single module.

And more importantly, I've tested single-module version with the demo app and our other apps and it doesn't solve the pipe injection problem that we currently encounter with the File component.

@PowerKiKi
Copy link
Member Author

True, it does not solve the pipe injection, which is extremely surprising 😲 ...

@PowerKiKi
Copy link
Member Author

Closing because #72 (comment)

@PowerKiKi PowerKiKi closed this Feb 1, 2021
@PowerKiKi PowerKiKi deleted the single-module branch May 25, 2022 07:59
@PowerKiKi PowerKiKi mentioned this pull request Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants