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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Talc – A fast and flexible allocator for no_std and WebAssembly

121 点作者 excsn大约 1 年前

6 条评论

tekacs大约 1 年前
I&#x27;ve been using this recently in WASM, in particular for the counters feature. It&#x27;s really great and it makes it super easy to track and follow the evolution of your app&#x27;s memory!<p>In my console, I have something akin to this:<p><pre><code> TRACE client_wasm::plugins::allocation: Memory stats counters=Counters { allocation_count: 165454, total_allocation_count: 18756119, allocated_bytes: 34654828, total_allocated_bytes: 3185258585, available_bytes: 82802636, fragment_count: 5026, heap_count: 1, total_heap_count: 1, claimed_bytes: 118423552, total_claimed_bytes: 118423552 } </code></pre> I haven&#x27;t carefully benchmarked dlmalloc (Rust&#x27;s default WASM allocator, <a href="https:&#x2F;&#x2F;github.com&#x2F;alexcrichton&#x2F;dlmalloc-rs">https:&#x2F;&#x2F;github.com&#x2F;alexcrichton&#x2F;dlmalloc-rs</a>), but it&#x27;s nothing special (to my knowledge). The swap to Talc is pretty trivial and it&#x27;s clear that the author is paying attention to its performance.
评论 #39547351 未加载
评论 #39546998 未加载
speps大约 1 年前
Added a new issue [1] to add TLSF to the benchmarks as it&#x27;s likely going to be faster in a single-threaded environment according to the rlsf crate [2].<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;SFBdragon&#x2F;talc&#x2F;issues&#x2F;26">https:&#x2F;&#x2F;github.com&#x2F;SFBdragon&#x2F;talc&#x2F;issues&#x2F;26</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;yvt&#x2F;rlsf">https:&#x2F;&#x2F;github.com&#x2F;yvt&#x2F;rlsf</a>
评论 #39547369 未加载
lasiotus大约 1 年前
Some extra context for comparison: Talc is faster than Frusa when there is no contention, but slower when there are concurrent allocations. Both are much slower than Rust&#x27;s system allocator. Benchmark here: <a href="https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;frusa" rel="nofollow">https:&#x2F;&#x2F;crates.io&#x2F;crates&#x2F;frusa</a>.
评论 #39554981 未加载
评论 #39567572 未加载
gleenn大约 1 年前
As a guy who lives in the JVM most days and mostly ignores allocation optimizations, what are some examples of things that are actually newer features in such a project? Isn&#x27;t allocation a mostly solved problem? Is something about WebAssembly or no_std actually requiring different features?
评论 #39545791 未加载
评论 #39545799 未加载
评论 #39545914 未加载
评论 #39547272 未加载
评论 #39547069 未加载
评论 #39545867 未加载
评论 #39545871 未加载
weinzierl大约 1 年前
Why isn&#x27;t it benchmarked against the vanilla glibc allocator? Is it similar enough to dlmalloc that the differences don&#x27;t matter?
评论 #39548285 未加载
caleb-allen大约 1 年前
Pardon my ignorance, but is this something that a language with a GC could potentially use to run in a WebAssembly environment?
评论 #39550254 未加载