TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Fast Allocations in Ruby 3.5

262 点作者 tekknolagi3 天前

8 条评论

hinkley3 天前
&gt; I’ve been interested in speeding up allocations for quite some time. We know that calling a C function from Ruby incurs some overhead, and that the overhead depends on the type of parameters we pass.<p>&gt; it seemed quite natural to use the triple-dot forwarding syntax (...).<p>&gt; Unfortunately I found that using ... was quite expensive<p>&gt; This lead me to implement an optimization for ... .<p>That’s some excellent yak shaving. And speaking up … in any language is good news even if allocation is not faster.
评论 #44069998 未加载
N_A_T_E1 天前
Ruby keeps on getting better. I wouldn&#x27;t hesitate to start new projects in ruby.
评论 #44080334 未加载
alberth3 天前
Can someone explain, is YJIT being abandoned over the new ZJIT? [0]<p>And if so, will these YJIT features likes Fast Allocations be brought to ZJIT?<p><a href="https:&#x2F;&#x2F;railsatscale.com&#x2F;2025-05-14-merge-zjit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;railsatscale.com&#x2F;2025-05-14-merge-zjit&#x2F;</a>
评论 #44063433 未加载
评论 #44070955 未加载
评论 #44062503 未加载
评论 #44066682 未加载
评论 #44062495 未加载
90s_dev3 天前
It seems to me like all languages are converging towards something like WASM. I wonder if in 20 years we will see WASM become the de facto platform that all apps can compile to and all operating systems can run near-natively with only a thin like WASI but more convenient.
评论 #44070896 未加载
评论 #44062810 未加载
评论 #44065580 未加载
hinkley3 天前
&gt; It’s very rare for code to allocate exactly the same type of object many times in a row, so the class of the instance local variable will change quite frequently.<p>That’s dangerous thinking because constructors will be a bimodal distribution.<p>Either a graph of calls or objects will contain a large number of unique objects, layers of alternating objects, or a lot of one type of object. Any map function for instance will tend to return a bunch of the same object. When the median and the mean diverge like this your thinking about perf gets muddy. An inline cache will make bulk allocations in list comprehensions faster. It won’t make creating DAGs faster. One is better than none.
评论 #44066108 未加载
评论 #44065417 未加载
firemelt3 天前
did it means more speeds to all rails&#x2F;active records collections?
ksec3 天前
I know I may be jumping the gun a little here but I wonder what percentage speedup could we expect on typical rails applications. Especially with Active Record.
评论 #44062923 未加载
评论 #44063137 未加载
评论 #44063339 未加载
GGO3 天前
dup of <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44057476">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=44057476</a>
评论 #44063010 未加载
评论 #44063144 未加载