TGTGInsighttelegram intelligenceLIVE / telegram public index
← Akasha Terminal: dev🍃
Akasha Terminal: dev🍃 avatar

TGINSIGHT POST

Post #2661

@AkashaTerminal

Akasha Terminal: dev🍃

Views215帖子阅读量
发布5月23日2025/05/23 06:53
Post content

帖子内容

Fast Allocations in Ruby 3.5 https://railsatscale.com/2025-05-21-fast-allocations-in-ruby-3-5/ https://news.ycombinator.com/item?id=44062160 Ruby 3.5 中的快速对象分配 Ruby 3.5 通过优化对象分配,显著提升了性能,尤其是在使用 YJIT 时,速度提升可达 6.5 倍。 Key Takeaways - Ruby 3.5 的对象分配速度比 Ruby 3.4.2 快 1.8 倍(无 YJIT)和 2.3 倍(有 YJIT)。 - 关键字参数越多,速度提升越明显,使用 YJIT 时速度提升可达 6.5 倍。 - 通过内联 Class#new 方法,消除了参数复制和栈帧开销。 - 优化减少了对象分配次数,尤其是关键字参数传递时的哈希分配。 - 该优化导致 Class#new 调用栈帧的缺失,可能影响调试信息。