3 ms·
> The performance of Rails serializers is still a nightmare Well, The performance of Ruby is still a nightmare. Not just serializers. It's that serializers in
by berkes 3y ago
> The performance of Rails serializers is still a nightmare
Well, The performance of Ruby is still a nightmare. Not just serializers. It's that serializers in Rails are the most prominent place where you'll have cpu-bound performance made visible.
But really. Just try anything cpu-bound (e.g. transform a huge list or CSV or so), and the lack of native, safe, threading, the horrendous performance of both the JIT compiler and the runtime and the language become apparent.
This isn't to criticize Ruby. Because once you see all the runtime inflection, the way it can modify itself runtime and the DSL magic it allows, the current performance is a magnificent feat! It should be impossible to have it perform at all, given these features.
That people managed to make such a beautiful language, with such marvelous features and still have it perform like it does, is a true engineering marvel.
- throwthrow5643 3y ago> It's that serializers in Rails are the most prominent place where you'll have cpu-bound performance made visible. Sorry, what other interpreted language has significantly better serializiation/deserialization performance than Ruby?
- berkes 3y agoPython, PHP and JavaScript have significantly better performance for cpu-bound programs. E.g. https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/ruby-php.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... And I have measured ser/de for PHP, Ruby (and Rust, we needed to know how much faster JSON serde in rust would be, and compared it to Ruby and PHP). Php is probably much faster because the JSON ser/de is apparently written in C.