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

Reason for precompiling #16

Open
rrrnld opened this issue Aug 24, 2016 · 2 comments
Open

Reason for precompiling #16

rrrnld opened this issue Aug 24, 2016 · 2 comments

Comments

@rrrnld
Copy link

rrrnld commented Aug 24, 2016

Hello,

It says the following in README.md:

So we've cheated a little bit by using babel-node. While this is great for getting something going. It's not a good idea to use it in production.

We should be precompiling your files, so let's do that now.

I'm curious, why exactly is it not a good idea? Isn't the code getting executed the same? And as servers are generally longer-running then clients, the code doesn't get recompiled so often but only when the app crashes or gets redeployed. I see the advantages of pre-compiling on the client side, but I'm not sure why it's necessary on the server side. Could someone elaborate?

@vovkasm
Copy link

vovkasm commented Oct 9, 2016

from https://babeljs.io/docs/usage/cli/#babel-node:

You should not be using babel-node in production. It is unnecessarily heavy, with high memory usage due to the cache being stored in memory. You will also always experience a startup performance penalty as the entire app needs to be compiled on the fly.

@Prinzhorn
Copy link

Our medium sized Express app takes about 20% more memory (120MB vs 100MB) and startup time is not that important if the process is long-running. The docs only list these two reasons, does that mean if we're aware of these downsides it is safe to use in production?

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

No branches or pull requests

3 participants