5 ms·
I would call it much more than just a performance optimization. A good story on parallelism is fairly high on anyone's list looking to move away from a GIL lan
by kjeetgill 8y ago
I would call it much more than just a performance optimization.
A good story on parallelism is fairly high on anyone's list looking to move away from a GIL language like Python and I believe Ruby.
As I'm sure you're aware, parallelism isn't always easy to bolt on afterwards. Once a glut of your code is written violating your (unwritten) memory model you're never quite sure if you've gotten rid of that last race condition.
- weberc2 8y agoYou're describing a performance optimization. Yes, if you write unoptimized code, it often takes some refactoring to support the optimization. Also, Python and Ruby are proof that languages can be tremendously successful at solving a huge array of problems without shared memory parallelism in v1.0. Besides, Crystal is presumably much faster than either of these languages with a single thread, so the relative advantage of (CPU) parallelization is much less.
- sriram_malhar 8y agoCrystal's programming model is about concurrent actors that don't share memory. Nothing should break when they move to multiple threads/event loops; it just needs the scheduler to schedule multiple fibers onto different threads. It's a solved problem.
- jashmatthews 8y agoIt's actually pretty low on the list. Ruby already has a production-ready implementation without a GIL: JRuby. Normal workloads like serving web requests or processing background jobs aren't impacted by the GIL. You simply run one process per core just like with NodeJS. Huge, huge sites successfully run on Ruby/Python. YouTube, GitHub, AirBnB, ZenDesk, Zapier etc. Larry Hasting's has some talks online on the Python GILectomy. The major issues are around how to keep the VM simple and fast. IUUC the C extension issues are fairly minor in comparison because the GIL never guaranteed much anyway.