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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Using Rust with Elixir for code reuse and performance

121 点作者 NiklasBegley超过 3 年前

4 条评论

Zababa超过 3 年前
&gt; Unsurprisingly, Rust outperforms Elixir by 2 orders of magnitude.<p>That seems very surprising to me. Is this a common result? I&#x27;ve heard that the BEAM is not the best for &quot;number crunching&quot; code, is this one of those scenarios? Is this really just the raw performance of the languages, or a difference in algorithms? There&#x27;s also no mention of the version of Elixir and the OTP. Did the JIT change anything?
评论 #28237702 未加载
评论 #28241785 未加载
nickjj超过 3 年前
I wonder if they looked into using <a href="https:&#x2F;&#x2F;github.com&#x2F;asaaki&#x2F;cmark.ex" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;asaaki&#x2F;cmark.ex</a> which is an already made Markdown Elixir NIF written in C. No glue code needed since the package already exists.<p>Back when I was writing Elixir, it&#x27;s what I used to process Markdown and it was also substantially faster than the native Elixir Markdown library (Earmark).
评论 #28235216 未加载
评论 #28234239 未加载
评论 #28234671 未加载
评论 #28234188 未加载
latch超过 3 年前
One thing to keep in mind is that even the simplest Rust NIF will significantly slow your builds and increase your repo&#x2F;artifact sizes.
评论 #28236680 未加载
评论 #28236872 未加载
评论 #28241214 未加载
bb1234超过 3 年前
For someone who does not know much about NIFs, will it be a lot slower if the Rust service is coded as a command line application and then invoked using System.cmd? Is that a good alternative?
评论 #28237223 未加载