Skip to content

Increase performance by checking for @jsx comment before compiling.#22

Open
niondir wants to merge 1 commit into
petehunt:masterfrom
niondir:master
Open

Increase performance by checking for @jsx comment before compiling.#22
niondir wants to merge 1 commit into
petehunt:masterfrom
niondir:master

Conversation

@niondir

@niondir niondir commented Oct 19, 2014

Copy link
Copy Markdown

It saves me some seconds if I only pass files with the @jsx header to React.transform. All other files have no need to be transformed.

@zertosh

zertosh commented Oct 21, 2014

Copy link
Copy Markdown

@niondir: /** @jsx React.DOM */ is going away in React 0.12 http://facebook.github.io/react/blog/2014/10/16/react-v0.12-rc1.html#the-jsx-pragma-is-gone

@niondir

niondir commented Oct 24, 2014

Copy link
Copy Markdown
Author

Good point. A better solution for may problem would be to defined include/exclude paths from where files are pares. Currently it's filtered only based on the extension.
I wan't at least exclude all node_module dirs. Or include only one subdirectory of my project like "/public".

@mweibel

mweibel commented Jan 4, 2015

Copy link
Copy Markdown

👍 a PR might be the wrong place to discuss this, but I just had an issue with this. node-jsx injecting itself into the default .js extension loader will lead to a massive memory usage increase. I switched now to .jsx and renamed all JSX files, memory usage went from ~300MB down to ~40MB.
I think there should be at least a warning in the README to prevent everyone from doing the same mistake.

@niondir

niondir commented Jan 7, 2015

Copy link
Copy Markdown
Author

Yep, it's not only the memory usage but also the startup time. Checking for the extension is probably the best way to solve the problem. That's what I do now, too.

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.

3 participants