Re:38% of bugs at Airbnb could have been prevented by using ...
by est31 on Monday February 11, 2019 @04:05AM
(#19133003)
> the only "threading" that ruby and python support natively is the spawn-another-process-and-find-a-way-to-coordinate kind
Are Javascript workers something different?
Re:38% of bugs at Airbnb could have been prevented by using ...
by akvadrako on Monday February 11, 2019 @05:05AM
(#19133245)
According to the Node 11 docs, worker threads are more lightweight than processes, but still heavy.
That makes me think they run in the same address space, but use separate runtimes. So it's more scalable than ruby and python threads or multiprocessing.
Re:38% of bugs at Airbnb could have been prevented by using ...
by jashmatthews on Monday February 11, 2019 @07:28AM
(#19133908)
JRuby doesn't have a GIL to begin with so there's no requirement to use multiprocessing to host Rails apps etc.
They're an improvement over a single GIL but not by much. IIUC, they're like Racket's Places: a complete duplication of the VM but sharing an address space. The basic implementation doesn't really save much memory but it's a bit more convenient.
There's been a couple of attempts to implement subinterpreters for CRuby too.
Re:38% of bugs at Airbnb could have been prevented by using ...
by regularfry on Monday February 11, 2019 @10:10AM
(#19134954)
JRuby is an incredibly underrated piece of kit. That startup time, though...
Re:38% of bugs at Airbnb could have been prevented by using ...
by hardwaresofton on Monday February 11, 2019 @07:26AM
(#19133892)
A good article on them:
https://medium.com/lazy-engineering/node-worker-threads-b57a...
Re:38% of bugs at Airbnb could have been prevented by using ...
by jashmatthews on Monday February 11, 2019 @04:22AM
(#19133081)
The GIL still allows for parallel IO so typical applications never need async. Modern Ruby just runs one process per core much like NodeJS in clustered mode or on JRuby with no GIL.
Also, the async IO support via libraries are there for ruby and python, but that brought along with it significant fragmentation (at the very least in the python case, I know less about ruby) -- no one was 100% sure whether to use tornado, twisted, gevent/eventlet for a very long time.
A quote from another comment I wrote[1]:
>> If we really want to get in the weeds, we could talk about python 2.x's floundering around async IO -- IIRC Twisted/Tornado/Gevent/Eventlet were all close to equally good options (and thus mindshare was split) while node had it built in, with a virtualenv-by-default packaging system. Also there's WSGI -- the interoperability it provides is cool, but also means more moving parts than a simple node+express setup.
[EDIT] - It's a little unfair of me to decry the fact that multiple good solutions existed as a bad thing when I'd say it was a strength of the ecosystem. I do think it's valid to discuss the issues with packages that weren't compatible across interface boundaries between these async io libraries though.
> (I guess Perl does too, but I haven't used Perl for 10 years)
Same here, it's been a similar duration since I've used Perl for anything but even back then, the major difference between perl and the others was extremely good native regex support and the ability to spawn system threads that actually ran in parallel without coordinating another process.
> I admit the promise pattern may be simpler to understand, but if you need to build a heavily evented system Node doesn't provide anything unique that can't be achieved in other ecosystems.
My point was about the ease of achieving it... In the last ~3 years I've seen a wave of articles in the python blogosphere about how to properly use asyncio and all these new async-enabled libraries pop up (the old ones that relied on twisted/eventlet/whatever else are still around of course and perfectly good) -- what I'm saying is that JS has had this since the get go, and it's been thrashing python/ruby on benchmarks that favor the usecase for the same amount of time, especially if someone doesn't use one of the appropriate libraries.
NodeJS's async io story is "batteries included", and that's huge in this day and age. Whether node has the right interface or if they made it ergonomic enough is a whole 'nother thing though...
[0]: https://docs.python.org/3/library/multiprocessing.html
[1]: https://news.ycombinator.com/item?id=18756083