Earlier quoted context omitted.
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 l…
Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
21–30 of 63 posts
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#22So 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.
Worded differently: does the strict concept of ownership/lifestimes in Rust bias a default (naive) implementation towards lower performance (eg due to required copying) when compared to a naive Golang (or even Java) implementation?
I have no doubts that after heavy optimization, Rust beats languages such as Go & Java.
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#23Earlier quoted context omitted.
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 l…
Ah, I think I remember that image meme from a long time ago (I never would have connected those dots). Thanks for the context here, it actually helps take the edge off!
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#24In 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.
"Poe's law is an adage of Internet culture which says that, without a clear indicator of the author's intent, any parodic or sarcastic expression of extreme views can be mistaken by some readers for a sincere expression of those views."
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#25Earlier quoted context omitted.
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 l…
Ah, I think I remember that image meme from a long time ago (I never would have connected those dots). Thanks for the context here, it actually helps take the edge off!
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#26I 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.
They either need to mark their functions `unsafe`, or use lifetimes (which may require changes in some APIs, which may be the reason they didn't).
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#27Earlier quoted context omitted.
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.
Yes, and this is what I was curious about, because I haven't seen the performance cost of this discussed a lot. Worded differently: does the strict concept of ownership/lifestimes in Rust bias a default (naive) implementation towards lower performance (eg due to required copying) when compared to a naive Golang (or even Java) implementation? I have no doubts that after heavy optimization, Rust beats languages such as…
When I learned Rust, I actually never went with the "use clone or Arc to make your life easier while learning" recommendation but always used references and learned how to use lifetime declarations and program design to go as far with them as reasonable. TBF I had experience with C and C++ already. But once reasonably experienced working in Rust (after a year?), your code should be faster most of the time the way you write it on the first try without needing optimization work.
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#28Earlier quoted context omitted.
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
#29So 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?
The Rust code and the blog post, on the other hand, seem to be written by someone less familiar with Rust and high-performance parsing. I think they would have avoided all their problems if they just used lifetimes to safely avoid copying from the start, instead of relying on increasingly elaborate workarounds like the `Bytes` crate. Apart from one "forces one to deal with the contagion of lifetimes" comment in the conclusion, they never mention why they didn't do this, even though it's clearly the idiomatic Rust solution. Maybe they had technical reasons for not doing lifetimes, but to me it just seems like unfamiliarity with Rust.
Re: Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance
#30Earlier quoted context omitted.
> 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.
Whilst still being 1/3rd slower than the Go version.