5 ms·
Look for tenderlove’s comments on TruffleRuby. The performance is at the expense of memory.
by owens99 6y ago
Look for tenderlove’s comments on TruffleRuby. The performance is at the expense of memory.
- eregon 6y agoWhich comments?
- loic-sharma 6y agohttps://blog.heroku.com/ruby-3-by-3/ https://blog.heroku.com/ruby-3-by-3/
- deleted 6y ago[deleted]
- hinkley 6y agoIn Ruby, as in NodeJS, the GIL pushes you to scale horizontally. The memory footprint of Hello World becomes a big problem, because the number of copies you run will be proportional to the number of cores you have, not the number of machines. You get no benefit from moving from an 8 core box to 16 or 20 cores. I suspect if they do manage to pull off more concurrency in Ruby 3, that vertically scaling machines will make more sense. If 8 cores benefit from a shared footprint, instead of one core per process, then the budget looks more attractive. So now might not be the right time to cherry-pick some of these features, but it may not be far off.
- chrisseaton 6y agoTruffleRuby doesn't have a GIL though.
- jashmatthews 6y agoThere are some important differences here between NodeJS and Ruby. NodeJS child processes are completely independent and created with spawn. https://github.com/nodejs/node-v0.x-archive/issues/2334 https://github.com/nodejs/node-v0.x-archive/issues/2334 CRuby forks using fork() and Copy-on-Write shares memory from parent to child. JRuby doesn't have a GIL so you only need a single process. Same with TruffleRuby. With CRuby, you're much better to run a bigger container with multiple processes than one process per container. With either NodeJS or CRuby you're still better to run less containers on bigger hosts. Each host has to duplicate the host OS and container infrastructure. Each container of a real production app also duplicates a bunch of stuff despite Docker's best attempts at sharing.
- 3np 6y agoNodeJS is single-threaded while Ruby has native threads and "fibers" - what makes you say you wouldn't be able to utilize additional cores in Ruby?
- schneems 6y agoFibers are still restricted by the GVL. Threads are also restricted by the GVL. The only "true" concurrency in MRI is to fork a process.