5 ms·
I wonder if people insisting that they use node.js for scalability and high concurrency (two false but popular reasons) will now reconsider their decision becau
by curiousjorge 11y ago
I wonder if people insisting that they use node.js for scalability and high concurrency (two false but popular reasons) will now reconsider their decision because this blows node.js out of the water.
https://www.techempower.com/benchmarks/#section=data-r10&hw=peak&test=json https://www.techempower.com/benchmarks/#section=data-r10&hw=...
- BinaryIdiot 11y ago> because this blows node.js out of the water. Using your same link I find this solution blowing node away in JSON serialization but the other benchmarks? Not so much. In fact complete opposite for some of them. As far as I have found there is no "best at everything" language and framework so your binary question doesn't make much sense. I'm also not convinced of this solution in a large web application because debugging and unit testing would be nightmare .
- rudolf0 11y agoOpenResty is considerably faster than Node in the JSON serialization, single query, and plaintext benchmarks. It is slower than Node in the multiple queries benchmark, and missing from the other benchmarks. So, it's a bit more inconclusive than you describe. I'd expect OpenResty to be much faster than Node for a lot of common web interactions. Node has better support for interacting with external services asynchronously, though.
- bigtunacan 11y agoThis won't have any impact on the node.js community. OpenResty has been around since 2011 and it's had some pretty screaming fast benchmarks for quite awhile, yet it still sees little traction. Lapis is great, Lua is super simple to work with and a total pleasure as well, but it just doesn't seem to be gaining much traction. There continually seems to be this belief that Lua is language only for game scripting; outside of that it is largely ignored.
- rudolf0 11y agoFor web applications, you're definitely going to get better performance with OpenResty. However, Node has one advantage: you can write any sort of socket server with it. With nginx/OpenResty, you're stuck with HTTP(S) servers. The creator of OpenResty has expressed interest in eventually extending it to work for non-HTTP usecases though.
- jfroma 11y agoPlease don't get me wrong I'll love to use openresty, I love nginx, etc. But there are other reasons to use node: ecosystem and npm. Try searching a driver for a not so popular db on npm and you might find two different implementations in addition to the official driver. I'd love to see something like this on openresty.
- klibertp 11y ago> ecosystem and npm. Yeah. There are "Lua rocks" (https://luarocks.org/ https://luarocks.org/) for Lua, but they have a few hundreds of packages only. Compared to npm there's no comparison at all. On the other hand you wouldn't want to use RDBMS with OpenResty anyway, I think. The whole point of using Nginx scripting (especially with LuaJIT, which is awesome) is to be as fast as possible. True, DB connections are async in Resty, but they are still going to take some time. For simple data that don't need to be persistent it's better to use ngx.shared - an in process dictionary shared between all scripts. For more complicated or persistent data, you have Redis and other fast solutions. Additionally, Nginx offers a full non-blocking socket API to Lua scripts. You can write a "driver" for anything that wants to speak to you over a network.