Assuming that we have millions of requests per day. Is the HTML processing in Node.js with Jade slower or faster than PHP's render engine? Or doesn't matter because the difference is really small?
I'm using Node.js with the Jade template engine, I really like it. But I was always the guy who worried about performance. I started my developer career with PHP, it was fun but now Node seems much much better, so I decided to switch.
I use Jade to Render HTML, because node.js alone lacks it(I know this sounds a bit stupid because Jade is node too :P). But because Jade is a module in Node I'm a bit confused, maybe this can slow the rendering process down.
Due to the V8 engine, asynchronous execution, and real-time server interaction, Node. js offers a better execution speed and certainly outperforms PHP.
js faster than PHP? Because of a slower loading process rendered by PHP, Node. js is the winner in terms of performance and code execution speed. It eliminates the waiting downtime and provides real-time data in a much more efficient manner, which allows using Node.
Comparing Node. js with PHP, the first is inherently asynchronous, event-driven, and non-blocking, while the second is a synchronous programming language. This means that Node. js is more viable than PHP for speeding up development.
js may be faster than the “standard” webserver with PHP because it runs as a single thread with non-blocking IO for each connection, hence there is no memory overrun. Due to this, Node. js is useful when there is a need to process data in real-time (chats, games, video, big data streams without logic). However, Node.
Jade isn't designed for speed, it's designed for elegance. If you're really concerned with speed there are other javascript rendering engines that are faster.
Check out http://jsperf.com/dom-vs-innerhtml-based-templating/63 (note that the chrome results match closely to node.js performance)
But that's all assuming the rendering engine is the bottleneck, and not the DB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With