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.

Rust Faster

114 pointsby jaxonduover 9 years ago

8 comments

geofftover 9 years ago
Fascinating things I learned from this article:<p>1. The benchmarks game is mostly a game of who can solve the problem fastest with the constraint of &quot;all the code has to be in this language.&quot; It&#x27;s not about how anyone would realistically write the code; if ludicrous optimizations were in-scope for any real-world project, so would be <i>calling out to a different language</i>. It&#x27;s worse than the usual problem of benchmarks being unrepresentative of real code; the implementations are also unrepresentative.<p>2. Apparently performant Haskell involves unchecked raw memory access? What&#x27;s the story there?
评论 #10326445 未加载
评论 #10326461 未加载
评论 #10326566 未加载
评论 #10327043 未加载
评论 #10326621 未加载
评论 #10326586 未加载
Everlagover 9 years ago
I&#x27;ve been working with rust for about a week now and I&#x27;ve found it a mirror of go in several ways.<p>Go aims to be simple with the aim of being &#x27;easy&#x27; to start writing idiomatically within a few days of jumping into the language. Comparatively, rust is a behemoth in terms of complexity.<p>There&#x27;s the completely relevant compilation speed difference: if rust could compile within 5-10x the time go does, it would be much more pleasant to work with. Being able to compile within 2 seconds on large projects is crazy for iteration speed; having to wait upwards of 10 seconds on toy projects is not.<p>However, rust is stupid fast while also being safer than go. Also, generics; that&#x27;s a flamewar for another day.<p>Context: I&#x27;ve been working with go for around 2-3 years now. I recently decided to pick up rust because of the guarantees it provides along with the crazy performance.
评论 #10326416 未加载
评论 #10326495 未加载
评论 #10327297 未加载
评论 #10326560 未加载
评论 #10327879 未加载
acconstaover 9 years ago
The author also points out that some of the benchmarks poorly represent real workloads:<p>&quot;Bottom up (since the worst offenders are now first),<p>binary-trees is silly since it measures allocation speed for a case that simply doesn&#x27;t exist in real code;<p>thread-ring is basically insane, since nobody ever bottlenecks like that;<p>chameneos-redux&#x27;s C++ implementation is ridiculous. The C is not so ridiculous, but you still have the problem that basically every language in the top few spots does something completely different;<p>pidigits tests whether you have bindings to GMP;<p>regex-dna tests a regex engine on a small subset of cases (arguably the first half-acceptable benchmark);<p>k-nucleotide tests who has the best hash table for this particular silly scheme, and they don&#x27;t all even do the same thing (eg. Scala precompacts, like my new Rust version);<p>mandelbrot is kind&#x27;a OK;<p>reverse-complement would be kind&#x27;a OK if not for a few hacky implementations (like the Rust);<p>spectral-norm is kind&#x27;a OK;<p>Haskell basically cheats fasta (which is why I copied it);<p>meteor-contest is too short to mean anything at all;<p>fannkuch-redux is probably kind&#x27;a OK,<p>n-body is kind&#x27;a OK.<p>So maybe 5&#x2F;13 are acceptable, and I&#x27;d still only use 4 of those. I think if looking at mandelbrot, spectral-norm, fannkuch-redux and n-body you can argue the benches are a reasonable measure of peak performance. However, these cases are also all too small and simple to really be convincing either, nor is it particularly fair (where&#x27;s NumPy for Python?).&quot;<p><a href="https:&#x2F;&#x2F;users.rust-lang.org&#x2F;t&#x2F;blog-rust-faster&#x2F;3117&#x2F;12?u=acconsta" rel="nofollow">https:&#x2F;&#x2F;users.rust-lang.org&#x2F;t&#x2F;blog-rust-faster&#x2F;3117&#x2F;12?u=acc...</a>
评论 #10328503 未加载
评论 #10328416 未加载
techdragonover 9 years ago
Every time I look at rust and posts about rust like this one. It occurs to me that &quot;I can use this to write &#x27;C&#x27; libraries&quot; and a variable number of moments later, I think to myself that I&#x27;ll keep Go at the bottom of my list of languages to learn to program in, after Ruby, Lisp, Fortran, COBOL, and Intercal, I&#x27;ll get to Go one day, if it&#x27;s still relevant to me, for now Rust + Erlang &#x2F; Elixir on FreeBSD is like having my own personal unicorn.<p>I&#x27;ve been meaning to work on a proper &quot;Erlang&#x2F;OTP-ish&quot; framework for Python for a long time, Pulsar[1] is a good start but needs more developers, and more documentation in order to grow. It has an example that does web sockets with normal Django, no massive hacks. (Which someone more familiar with Django should really check out and talk about more widely) But no Flask example?<p>1 - <a href="https:&#x2F;&#x2F;github.com&#x2F;quantmind&#x2F;pulsar" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;quantmind&#x2F;pulsar</a>
评论 #10328018 未加载
fijalover 9 years ago
&quot;A staple of all performance discussion is the great Computer Language Benchmarks Game.&quot; this is so sad, but true
dikaiosuneover 9 years ago
Very cool, and definitely gives me some insight into those benchmarks. Which makes me wonder -- are there benchmarks for &quot;boring&quot; programs in a variety of languages? I&#x27;m generally more interested in the execution speed of implementations that I would actually have time to write when on a deadline.
评论 #10326397 未加载
评论 #10327590 未加载
评论 #10326591 未加载
mcguireover 9 years ago
&quot;<i>k_nucleotide is a test of how fast your Hash map is.</i>&quot;<p>Speaking of Rusts&#x27; HashMap, the Robin Hood map is pretty darn sweet (and I say that as someone who translated a Pythonish map to Rust), but the last time I looked it was still throttled by SipHash.[1] Is there any progress on SIMD-ing that?<p>[1] &quot;Safety vs. performance&quot;, etc., etc.
评论 #10328077 未加载
imaginenoreover 9 years ago
The requirement to read line by line is ridiculous.