Open pofider opened 7 years ago
This now works nicely and it is like 2x faster than previously.
However we have still place for improvements. We can live with this for now, but I would like to note here what we should look at if we have the need or time in the future.
The startup time is currently only 95% perfect, because the extra bundle, which should just parse the args and make the rest call is 4MB in size. This looks really ridiculous for such task. I understand that we require a module which require many other modules and the size easily grows. However maybe we can take some time and analyze the output bundle. Rough look shows 500kb just for lodash... Maybe we can rapidly decrees the size by lazily requiring in CLI or by carefully choosing modules we use there.
Lets keep this open. I believe the cli and executable usage will rapidly grow and the need for this will anyway come.
The startup time is currently only 95% perfect, because the extra bundle, which should just parse the args and make the rest call is 4MB in size. This looks really ridiculous for such task. I understand that we require a module which require many other modules and the size easily grows. However maybe we can take some time and analyze the output bundle. Rough look shows 500kb just for lodash... Maybe we can rapidly decrees the size by lazily requiring in CLI or by carefully choosing modules we use there.
yes, for sure! when building the CLI i never thought about the importance of startup time, but it totally makes sense in the context of a CLI and an executable, so as you say, maybe we can replace some modules with others with less dependencies and apply some lazy requires on CLI startup, definitely there is room for improvements
@bjrmatos Could you make a quick estimation how long it would take you to make this reality? I think we should be able to get close to just node.js startup time, but right now we are really far. We would be able to give this task the right priority afterwards. Thank you.
Could you make a quick estimation how long it would take you to make this reality?
i think it can take one or two days, hopefully there wont be edge cases and we will be able to find replacements for the large dependencies.
Currently, even with keepAlive option, we ask V8 to load the whole bundle. This takes like 1 second and it is the main place where the optimization should be evaluated.
We should evaluate if it makes sense to split the code into 2 bundles to speed up the startup time for this case. I believe we should get to very small rendering times in the end.