Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This comparison is disingenuous. They’re using a completely different data structure and getting a slight difference in performance, and are chalking this up to language differences. Sure, it might be harder to implement at B-Tree in C than it is in Rust. But then you can just use C++? Don’t make an apples to oranges comparison.


> [They] are chalking this up to language differences

That didn't happen. The data structure difference is discussed and the possibility of the performance difference being down to this is clearly acknowledged. Also discussed is the reason for the different data structures, which is actually the most important take-away.


> Also discussed is the reason for the different data structures, which is actually the most important take-away.

I agree; this would have been a great stand-alone piece had it focused on this instead of performance.


Suggestion: actually read the article.

It's one of the few high-quality technical articles that pass through HN... if you don't get hung up on the title.


Please don’t do this here; I did read the article and this is my response to it. If you have a meaningful comment to make on my analysis, please reply with that instead.


OK, read the article starting with the phrase "But that would be overlooking something important".

Normally, "read the article" is a bit not-HN-friendly, but when you call someone out as disingenuous because they didn't say things that they in fact do clearly call out and have a multi-paragraph discussion of, you are earning a "please read the article" response. They're not being disingenuous about what they are doing if they clearly explain what that is and then have a (IMHO) balanced pro-and-con discussion about it.


Regardless of the person's reaction, they do make a very good point. There is a weird thing that happens when you criticize Rust on HN or Reddit where lots of people jump in to prove that any criticism is invalid. I like Rust well enough. I like C too, I have my issues with both, but when someone does raise an objection it can be hard having people pile on them after.

A point of fact is that the two data structures are different. There was even an article on the front page today about how minor changes to data structures can dramatically impact performance.

Anyway, my main point is that there should be a space to discuss the relative merits and issues of languages without it resorting to petty fighting, which even you and the OP and the other commenter are engaging in.

Please everyone try to use the principle of charity when reading a post on this site. There is a good chance the person you are responding to has a reasonable background and isn't totally ignorant. Instead of playing on pedantry, try to understand where they are coming from and understand a one-off post on an internet forum is not the strongest argument they could make.


> There is a weird thing that happens when you criticize Rust on HN or Reddit

Can I ask where this impression came from? The original, now-downvoted comment that started this thread wasn't criticizing Rust, it was criticizing the article. If people disagree with that person's criticism of the article (which is itself not a criticism of C, and acknowledges as much), I'm afraid I don't see how that contributes to any perception that people are unjustifiably leaping to defend Rust.


> Can I ask where this impression came from?

Are you serious now? I mean you are very active Rust activist on both HN and Reddit and you exactly know what Rust Evangelic Strike Force is and where it came from. I've seen multiple threads on HN and Reddit where people do exactly what OP wrote. I don't know if it's denial or ignorance on your side or you are writing this with premeditation.


The "Rust Evangelism Strike Force" is a dumb meme (but I repeat myself) that gets used sarcastically, and was originally coined by people who were themselves critical of Rust. If you have links to instances of people doing exactly as OP wrote, please paste them here; I am mod of /r/rust, where we have had a "No zealotry" rule ("Stay mindful of the fact that different technologies have different goals and exhibit fundamentally different tradeoffs in pursuit of those goals.") since long before cat-v.org concocted the RESF, and I am happy to rein people in if their heads get too big. :)

As to whether my above question is serious, the answer is yes, because truth be told I see more people complaining about Rust Evangelism than I see instances of evangelism in the first place, to the extent that I wonder if that itself has become a meme by now.


> where we have had a "No zealotry" rule ("Stay mindful of the fact that different technologies have different goals and exhibit fundamentally different tradeoffs in pursuit of those goals.")

I've never wrote anywhere that you encourage that kind of behavior. There is a difference between encouraging and pretending that problem do not exist. Seems that you are just biased and what you are doing here is white washing a community you are part of.

> If you have links to instances of people doing exactly as OP wrote, please paste them here;

I would rather spend time with my family than searching whole HN and Reddit for obvious things that were mentioned here multiple times by multiple people but I've found couple of links fast (not for you, but for other readers) [1][2]. And this are only two examples that I've found fast. Those are examples of things that you surely have read and aware of. Another example is some Animats posts in some C++/Rust debate thread on HN in which he was describing his experience and technical details while criticizing Rust and was downvoted to hell.

Here you have another person writing same thing and dbaupp acknowledging that the problem exist [3].

This comments didn't come from vacuum and denying that problem exist will only make it worse.

[1] https://www.reddit.com/r/programming/comments/5fyhjb/golangs...

[2] https://news.ycombinator.com/item?id=17088181

[3] https://news.ycombinator.com/item?id=14178950


It's fairly clear from the context of the comment he was asking about where the impression came from in this thread. I have no doubt he was interesting because he believes it is somewhat unjustified and self perpetuating, but if this thread is any indication, there may be some truth to that.

So, to restate the question clearly and unambiguously, what prior to kibwen's question lends someone to think this is a matter of Rust evangelists taking issue, and not the somewhat common HN interaction of someone calling out someone else for, in their eyes, misinterpreting or ignoring and aspect something and then denigrating it for that lack?


Well, first let me take this out of the way: if plenty of people do what the OP was complaining about, I would welcoming he complaining about them, but not about people that didn't do it.

Now, I'm having problems understand what that Rust Evangelic Strike Force is, and what nefarious goals it could have. Do you have a pointer? (Also, is it a funny group?)


We're the Rust Evangelism Strike Force and we'll convince you to write more secure code!


Ok, sure, I’ll accept that calling the article itself disingenuous was a bit harsh. But it does seem like it sent the message that Rust was faster than C, when it is clearly not a fair comparison (as the author mentions themself). I’m actually relatively happy with that part, but it comes at the end and it’s clearly spawned discussion here that proves my point; look at the other comments: the other top-level one says that I should rewrite everything in Rust because it performed better here.


> look at the other comments: the other top-level one says that I should rewrite everything in Rust because it performed better here

That comment appears to be downvoted, and in addition the winking emoticon at the end suggests that it was meant to be tongue-in-cheek in any case.


It also says you should rewrite things in rust "anyway ;)", not "because it's faster".


It was the highest-voted top-level comment when I posted that.


It was probably one of the most recent comments. New comments get a temporary rating boost to give them a chance to be read and earn upvotes.


The article very clearly calls out the data structure difference.

Your statement that they simply are "chalking this up to language differences" is false. It's not surprising that you received a negative reaction.


Despite the author’s claim that they are not trying to make a comparison, and their lengthy discussion on the details why such a comparison is not apt, we still ended up with a title that suggests a comparison and comments that focus on the two languages in relation to each other.


That is a fair point. The title may be a bit misleading.

Although, not entirely, as I'm sure you would agree we can't claim that different data structure is the only reason that the rust program was fast.


Which is exactly why it's a terrible benchmark -- it doesn't tell you anything about what you care about. Which is one reason why it's a terrible article.

Another reason is that the author seems to have put a lot more engineering into the Rust program than the C program. Most of the word-count of the article is devoted to extra engineering on the Rust program! (The whole thing about sorting out lumps, etc). It's reasonable to infer that this also mirrors the situation prior to the first benchmark. If you put more effort into optimizing one program than another, you'd expect the higher-effort program to be faster, all else being equal.

It's embarrassing that HN thinks this article is worth posting. There might be something to write about here, somewhere, but it would have to be framed in a very different way in order to be honest. Also, it would be a much shorter article.


The author appears to disagree with your assessment in the previous article that is linked at the start:

Because I had written my Rust naively (and my C carefully), my hope was that the Rust would be no more than 20% slower — but I was braced for pretty much anything. ... my naive Rust was ~32% faster than my carefully implemented C.


I don't think the author was claiming that this is a rigorous benchmark, but I can see how it might look that way. I agree that it could have been framed a bit better, but I also don't think the author was trying to make any bold declarations.

The technical aspects of the article are interesting and well written, but only if it is not viewed as an exercise in rigorous benchmarking.

The context here was that the Rust program was a reimplementation of an existing C program, as part of an effort to learn Rust.


Unfortunately, that's not entirely accurate. The problem with language level benchmarking is that the benchmarks are only as good as their implementations and while I agree that different languages encourage different kinds of idioms it seems only fair to use the same data structure/technique when the language offers that choice (as Rust does with intrusive data structures).

The Rust program was not a faithful reimplementation as the author concedes. I expected a more closer comparison given the somewhat broad title of the article. Claiming the perf benefit came out of the thinking encouraged by the language is okay but debatable.


Can you think ofa simple, unambiguous, descriptive title?

How about — Why Rust BTreeMaps beat C AVL Trees ?

I don't know if that would be an adequate title, but it doesn't claim that different data structure is the only reason and it doesn't generalize to a claim about C and Rust.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: