upvote
> but so could FFI calls to another language for the CPU bound work

Worker threads can be more convenient than FFI, as you don't need to compile anything, you can reuse the main application's functions, etc.

reply
True! Although in a lot of Node you DO have a compile chain (typescript) you need to account for. There’s a transactional cost there to get these working well, and only sharing the code it needs. These days it’s much smaller than it used to be, though, so worker functions are seeing more use.

I make my comment to note tho that in many envs it’s easier to scale out than account for all the extra complications of multiple processes in a single container.

reply
> few gb of ram ...

5 years ago I never would have given this comment a second thought.

Now I read it and have to wonder: when does the price of ram start showing up in the butchers bill from your cloud provider?

reply
You have to pay that cost in a worker thread anyway, too. There’s no free lunch.
reply
I don't know about you, but my cloud provider has been charging me for the ram on my compute instances since the beginning.
reply
Ram has always been one of the major price drivers...

But the prices have gotten stupid: https://pcpartpicker.com/trends/price/memory/

https://appleinsider.com/articles/26/02/27/the-global-ram-an...

reply