News for hackers. Stuff that matters.
Re:The Performance Cost of Server Side Rendered React on Nod... by laurencerowe on Monday November 20, 2017 @11:01PM (#15745422)
It would be worth verifying that NODE_ENV=production is set during these benchmarks (I see no mention in either the article or the source repository.) Running in development mode has a significant performance impact.

Edit: This PR shows that is likely to be the case. Running in production mode along with some other minor changes shows React running at 88% the speed of Pug. https://github.com/janit/node-templating-benchmark/pull/1

Re:The Performance Cost of Server Side Rendered React on Nod... by anatoli on Monday November 20, 2017 @11:51PM (#15745611)
NODE_ENV=production definitely wasn't set based on some basic testing I did (that's my PR there), which accounts for the atrocious performance.

Also, the React component is created on each request instead of just being created once. Unless one's goal is to specifically colour the perception of React, I don't understand that decision alongside the code for Pug which precompiles the template a single time.

(Also declaring the map function outside the component and not creating a closure makes for a tiny extra boost.)

It's disappointing to see that the article took off to this extent given how misleading and inaccurate it is.

Re:The Performance Cost of Server Side Rendered React on Nod... by velmu on Tuesday November 21, 2017 @01:19AM (#15746041)
Hello Anatoli. Thank you for this. It was clearly an oversight on my part, not intentional to make React look bad. I have added a note on the article and will run the tests with the correct settings and your PR with further optimisation.
Re:The Performance Cost of Server Side Rendered React on Nod... by jeswin on Tuesday November 21, 2017 @01:34AM (#15746106)
Then you should withdraw the article until you get real numbers. This utterly misleading data (as of now) is going to be picked up by search engines and other blogs.

Add: on a positive note, this aspect of React is worth benchmarking. Thank you for that.

Re:The Performance Cost of Server Side Rendered React on Nod... by anatoli on Tuesday November 21, 2017 @08:17AM (#15747648)
No worries. The reader has as much responsibility to question the material they're consuming :)
Re:The Performance Cost of Server Side Rendered React on Nod... by zghst on Tuesday November 21, 2017 @12:32AM (#15745851)
It’s common in the dev (esp. JavaScript) community. The wild rush to be first to discover or disagree for karma points on the internet.