Good concurrency support lets you handle thousands (even millions) of these activities in a single process, which is massively more efficient than using a process each, and puts less load on other systems (DB, Splunk, Graphite, RabbitMQ…)
Green threads in particular make it possible to get these benefits without writing the code in async style. You just write regular, blocking code and the runtime / frameworks take care of yielding to the scheduler (event loop) when appropriate.
So did it run Rails?
If you're talking about producing a static binary then both Rubymotion and TruffleRuby can do this.
Ruby has already been doing threaded dispatch on bytecodes since 1.9.
Call-threading looks like this:
while(1) { interpreter_state = *virtual_program_counter++(interpreter_state); }
There's an indirect jump here.With context-threading you JIT very simple code which looks like this and has only direct calls:
interpreter_state = put1(interpreter_state);
interpreter_state = put1(interpreter_state);
interpreter_state = plus(interpreter_state);You can definitely compile anything... whether it's worthwhile is a totally different story. I learned this the hard way :)
As far as I remember the Ruby 3x3 effort yielded 3x on SOME workloads, with tremendous effort, which is about what I would have expected due to Ruby's very dynamic semantics.
The CRuby JIT for 3x3 built by one person in their spare time.
https://developers.redhat.com/blog/2020/01/20/mir-a-lightwei...