TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Go vs. Node vs. Rust vs. Swift on Ubuntu Linux 15.10

15 pointsby grigioover 9 years ago

4 comments

pcwaltonover 9 years ago
The &quot;use cases and opinions&quot; section is pretty nice, and I agree with it.<p>I would expect Rust and Swift to have the same execution performance on Fibonacci. In fact, I&#x27;d expect them to generate essentially identical LLVM IR. The fact that they have differences in performance leads me to believe that it&#x27;s some sort of &quot;LLVM IR optimization didn&#x27;t trigger because of a bug&quot; sort of issue—perhaps the optimization pass that converts recursive functions to loops.<p>I have to say, though: Beware of Fibonacci as a benchmark. I believe it&#x27;s vulnerable to a compiler that optimizes it to the closed form solution [1]. I don&#x27;t think compilers do this optimization today, but if you popularize a Fibonacci benchmark you will create market pressure for them to implement it and ruin your results. :)<p>[1]: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fibonacci_number#Closed-form_expression" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fibonacci_number#Closed-form_e...</a>
评论 #10710814 未加载
评论 #10710511 未加载
Recurecurover 9 years ago
That&#x27;s a quite small sampling of microbenchmarks, but still interesting.<p>One thing you failed to note is that only Rust and Swift aren&#x27;t garbage collected. That means that only Rust and Swift should be considered for applications where deterministic performance is required, in other words soft or hard real time.<p>Many games, for instance, have soft real time requirements.
评论 #10703754 未加载
sudorandomover 9 years ago
<p><pre><code> Golang: to enable all the cores, you have to put in your code runtime.GOMAXPROCS(num of cores you want to use) </code></pre> This is no longer true. With Go 1.5 and higher GOMAXPROCS is set to the number of CPUs available by default.
评论 #10704621 未加载
grigioover 9 years ago
here is the source, all the tests seem quite the same <a href="https:&#x2F;&#x2F;github.com&#x2F;grigio&#x2F;bench-go-rust-swift" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;grigio&#x2F;bench-go-rust-swift</a>