News for hackers. Stuff that matters.
Re:Node.js – v20.8.1 by winrid on Sunday October 15, 2023 @02:49PM (#37892287)
It was already pretty performant. The issue is as always runtime type checking. For serious stuff you really want that. Also, async everything is not fun. Simple code executed in a thread pool or whatever is so much easier to reason about.
Re:Node.js – v20.8.1 by chris222 on Sunday October 15, 2023 @03:12PM (#37892484)
Worker threads have been around for a bit:

https://nodejs.org/api/worker_threads.html

Re:Node.js – v20.8.1 by winrid on Sunday October 15, 2023 @03:34PM (#37892692)
yes and slow AF. also nobody is gonna use worker threads without async to handle API requests in NodeJS - why would you use nodejs then?
Re:Node.js – v20.8.1 by cypress66 on Sunday October 15, 2023 @04:15PM (#37893015)
> Simple code executed in a thread pool or whatever is so much easier to reason about. reply

Hard disagree. It's much easier to reason about async await because you don't need to worry about preemption. You (generally) don't need mutexes or anything like that.

Re:Node.js – v20.8.1 by winrid on Sunday October 15, 2023 @07:26PM (#37894361)
hard disagree. :)

When do you have to worry about synchronization? You don't. Pull DB connection from pool, etc, done.

Async await has colored functions, promises, and other atrocities.

Even if I have some locking primitives somewhere I'll GLADLY take that over the fucking mess of async stack traces and code executed "next tick" with no trace.

Re:Node.js – v20.8.1 by sgammon on Sunday October 15, 2023 @04:22PM (#37893071)
Performant in what sense?
Re:Node.js – v20.8.1 by winrid on Sunday October 15, 2023 @04:45PM (#37893249)
as in easy to handle tens of thousands requests a second with a few DB calls on a smallish server? do you want a PHD thesus on what performant means?
Re:Node.js – v20.8.1 by sgammon on Tuesday October 24, 2023 @04:08PM (#38004723)
Node JS caps at less than 10K RPS...
Re:Node.js – v20.8.1 by winrid on Wednesday October 25, 2023 @12:24AM (#38009100)
oh what machine? with how many workers? doing what?

search for "node" on this page: https://www.techempower.com/benchmarks/#section=data-r21

Re:Node.js – v20.8.1 by sgammon on Wednesday October 25, 2023 @03:19AM (#38010124)
Express, on Linux, with one worker because that's how you benchmark apples-to-apples. Node 20, with plenty of RAM and CPU, not that it uses it.
Re:Node.js – v20.8.1 by sgammon on Wednesday October 25, 2023 @03:20AM (#38010135)
Rather than searching "node" on TechEmpower I do my own comparative benchmarks in a given environment.

Node always loses. Every time. To everything. It reliably loses to Java, Python, and even other JavaScript engines. Which is why I asked... performant compared to what?