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

node-jsx in production #19

Open
nickdima opened this issue Oct 3, 2014 · 3 comments
Open

node-jsx in production #19

nickdima opened this issue Oct 3, 2014 · 3 comments

Comments

@nickdima
Copy link
Contributor

nickdima commented Oct 3, 2014

Is it a good idea to use node-jsx in production or better to pre-compile the files?

@petehunt
Copy link
Owner

petehunt commented Oct 3, 2014

Shouldn't make a difference

Sent from my iPhone

On Oct 3, 2014, at 10:50 AM, Nick Dima [email protected] wrote:

Is it a good idea to use node-jsx in production or better to pre-compile the files?


Reply to this email directly or view it on GitHub.

@tomaskikutis
Copy link

@petehunt are you sure ? https://github.com/petehunt/node-jsx/issues?utf8=%E2%9C%93&q=performance

Are there any benchmarks to compare performance of precompiled vs node-jsx ?

@jjmasse
Copy link

jjmasse commented Aug 5, 2015

@tomaskikutis So how this works is the install method bootstraps a callback to how Require treats .js files ( or whatever extension you provide in options ).

When @petehunt says "it shouldn't" - it really shouldn't since everything in the require chain should be in memory when your server is primed.

Hypothetically, if you create methods that use require outside of setting initial dependencies, you incur a performance hit since the files are transpiled through jstransform.transform(...) as part of the require process.

Depending on how you architect your application, you could end up running ..transform more often than you would like.

More on require.extensions:

require.extensions

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

4 participants