Live data from Hacker News

Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

greptime.com

11–20 of 63 posts

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#12

Earlier quoted context omitted.

Isn’t it tiring to think about every possible offence in the world and how someone somewhere will be offended by (knives, tires, cars, pens, saws, sharks, planes, needles, ropes, speakers, games, … you get the point) while writing an article about a programming language? At some point one needs to exercise common sense and learn to live in a public society where people speak and not everyone is out to offend you.

What does a weapon (a knife) have to do with an article about a programming language?

Exactly, then why does it matter that the author had anything in their post as a figure of speech or analogy?

Is it wrong to post a meme of a dog sitting near fire - https://knowyourmeme.com/memes/this-is-fine As a joke from SREs who handle firefighting calls? Does it offend dog lovers, people who are scared of fire?

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#13

Earlier quoted context omitted.

Isn’t it tiring to think about every possible offence in the world and how someone somewhere will be offended by (knives, tires, cars, pens, saws, sharks, planes, needles, ropes, speakers, games, … you get the point) while writing an article about a programming language? At some point one needs to exercise common sense and learn to live in a public society where people speak and not everyone is out to offend you.

What does a weapon (a knife) have to do with an article about a programming language?

I have no association with any of these communities, but the crab holding a knife was a somewhat well-known meme[1].

I guess it can also be viewed as a play on words, given that crablang is a fork.

Given that the creators of crablang explicitly say it was a "lighthearted response"[2] to some of Rust's changes, it makes sense that they'd use a meme for a logo.

That said, seems you're not alone in wanting a different logo[3].

[1]: https://knowyourmeme.com/memes/you-mess-with-crabo-you-get-a...

[2]: https://crablang.org/

[3]: https://github.com/crablang/crab/issues/59

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#14

So in this case, with some modest performance engineering, Golang is surprisingly fast out of the box, and Rust requires more effort and increasingly less idiomatic code to reach the same result. Is this typical?

While it’s a nice bed time story if you like go, the reality is no, it’s not typical.

Go has a good perf story, but typically rust or c++ would be faster after heavy optimisation; and should be more or less on par with typical applications. This isn’t a critique of go, and shouldn’t surprise anyone.

Typically go also has unexpected optimisation hoops to jump through and problems related to the heavy use of channels (see the well documented answer here: https://stackoverflow.com/questions/47312029/when-should-you...), so you would generally expect it to be slower…

…but, naive implementations are always slower, and really, it’s probably much of a muchness out the box for most day to day uses.

In almost all situations (even python or Java) you can get great performance if you invest time and effort in it.

But idiomatic code typically faster than rust? No, not really.

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#15

So in this case, with some modest performance engineering, Golang is surprisingly fast out of the box, and Rust requires more effort and increasingly less idiomatic code to reach the same result. Is this typical?

I think no. In this particular case it involves how Rust handles lifetimes compared to other languages with garbage collector.

Essentially it's a comparison between reference counting and tracing garbage collection based on reacheability.

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#16
post #2

In the image at the top of the article, why is the Rust crab altered to have "angry" eyes and holding a knife aimed at the Go gopher? Aside from the joke of "don't bring a knife to a protobuf fight" the inference of violence sucks and lessens the spirit of friendly competition and "all in good fun." I don't know if Rust has a code-of-conduct or rules for use of their mascot, but I bet this doesn't follow it.

It's the logo of CrabLang: https://crablang.org/

Thanks for that, good to know

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#17

Earlier quoted context omitted.

What does a weapon (a knife) have to do with an article about a programming language?

Exactly, then why does it matter that the author had anything in their post as a figure of speech or analogy? Is it wrong to post a meme of a dog sitting near fire - https://knowyourmeme.com/memes/this-is-fine As a joke from SREs who handle firefighting calls? Does it offend dog lovers, people who are scared of fire?

I don't think I understand the comparison. Can you think of another one that involves a weapon and directed violence?

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#19

So in this case, with some modest performance engineering, Golang is surprisingly fast out of the box, and Rust requires more effort and increasingly less idiomatic code to reach the same result. Is this typical?

While it’s a nice bed time story if you like go, the reality is no, it’s not typical. Go has a good perf story, but typically rust or c++ would be faster after heavy optimisation; and should be more or less on par with typical applications. This isn’t a critique of go, and shouldn’t surprise anyone. Typically go also has unexpected optimisation hoops to jump through and problems related to the heavy use of channels (…

> but typically rust or c++ would be faster after heavy optimisation;

it is concerning how much digging was required to optimize rust code in this case.

Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance

#20

I got confused through it ; is the resulting code still technically safe?

It's technically `safe` as long as you never access the decoded struct once the original bytes is dropped.

I believe that how `unsafe` works, the programmer, instead of compiler, ensures safety.

Post reply on HN