4 ms·
"Array#each is rewritten in Ruby for better performance"[1] was a surprise for me, with a Ruby implementation being 5.3x faster than the C implementation[2]. Y
by omoikane 2y ago
"Array#each is rewritten in Ruby for better performance"[1] was a surprise for me, with a Ruby implementation being 5.3x faster than the C implementation[2]. YJIT seems magical.
[1] https://bugs.ruby-lang.org/issues/20182 https://bugs.ruby-lang.org/issues/20182
[2] https://github.com/ruby/ruby/pull/6687 https://github.com/ruby/ruby/pull/6687
- pjmlp 2y agoAny JIT with good enough performance will do, same has happened in other languages. Turns out when JIT is good enough, the performance gains are much better than what is wasted marshling and going over the FFI boundary to C code. Another example, from Android, https://developer.android.com/reference/android/util/FloatMath https://developer.android.com/reference/android/util/FloatMa...
- neonsunset 2y agoPretty much the story of .NETs CoreLib, including even the most performance sensitive parts like memcpy/memmove. There’s probably no C++ code left in anything that isn’t JIT, GC and lower level parts of VM.
- pjmlp 2y agoGiven how close modern .NET and C# have come to systems languages like D and Modula-3, among others, it would be interesting as language nerd, to eventually see it fully bootstrapped. Probably won't happen though, for economical reasons, where to spend development budget.