2 ms·
Understanding Ruby 3.3 Concurrency: A Comprehensive Guide
- Daishiman 2y agoI don't see any benchmarks here but I wonder how this compares to equivalent Python concurrency primitives.
- cmittal79 2y agoyou can take a simple a+b code program written in both Ruby 3.3 and Python 3; and run it using concurrency features of each language and compare. This article has no intentions to provide any benchmarks and comparisons.
- cmittal79 2y agobenchmarks can never be right. machines with different specs will always show different results.
- phendrenad2 2y agoSeems like ractors would be perfect for a HTTP server.
- wutwutwat 2y agofalcon is worth a look https://github.com/socketry/falcon https://github.com/socketry/falcon
- phendrenad2 2y agoDoes that use ractors, or plan on using ractors? Seems like it uses fibers. Is it considered the best ruby server these days?
- wutwutwat 2y agoBest server is going to vary on your preferences and workload. Puma is a great multithreaded server, and it can do fork based workers as well. But unicorn is the go to for process/fork based workers. Falcon is newer and built on libraries that use the new fibers api. Not sure about ractors, but the code is there, have a look
- baggy_trough 2y agounicorn is pretty moribund. I think the maintainer has mostly moved on from ruby.
- tarellel 2y agoAt the moment I believe falcon uses fibers
- kubectl_h 2y agoYes I agree. Recently sat down and wrote some test ractor code to see if I could max out all my CPUs with a single ruby process running only ruby code and was pleasantly surprised to see that it works. The ruby systems I work on now scale to demand via kubernetes so it's not practical to find edge cases where I could apply ractors, but the future looks promising with real multi-threaded-like parallelism.
- vr46 2y agoA great update to older articles on Ruby concurrency. I pored over some of my code from Ruby to Rust - nothing exciting, turns hundreds of Instagram posts into Markdown text with resized and watermarked images - but maxes out my cores. Using actors, love those. Considering porting the code back now to Ruby to get some developer friendliness, er, back. And for fun just to see performance across 10 years of posts. Rust is cool but Ruby deserves to stay useful.
- rwjaht 2y agoThe Ruby syntax looks increasingly appealing to me. Does anyone have Ruby book suggestions for experienced programmers? I'm looking for something close to K&R or APUE style, preferably also with some coverage of Ruby's C-API. It does not have to be ultra modern or up-to-date, correctness and best practices are more important.
- emmanueloga_ 2y agohttps://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/ https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-e...
- udkl 2y agoAlso check https://crystal-lang.org/ https://crystal-lang.org/ which aims for ruby like syntax/dx but almost native performance
- deleted 2y ago[deleted]
- xfalcox 2y agoCan I safely use Ractors inside Rails if my tasks have a mix of CPU and I/O ?
- baggy_trough 2y agopresumably, but you wouldn't be able to use much of Rails itself within the ractor.