Readit News logoReadit News
kosherhurricane commented on Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance   greptime.com/blogs/2024-0... · Posted by u/signa11
wokwokwok · a year ago
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.

kosherhurricane · a year ago
It's really easy to improve the performance of Go implementation as compared to python or Java. There are lots of built-in tools to help you (like the profiler), and the resulting code is really very legible even to fresh college grads.

This is based on my first hand experience, but YMMV.

kosherhurricane commented on Fivefold Slower Compared to Go? Optimizing Rust's Protobuf Decoding Performance   greptime.com/blogs/2024-0... · Posted by u/signa11
MrBuddyCasino · a year ago
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?

kosherhurricane · a year ago
More or less.

For a language designed for fresh-out-of-college engineer to pick up in a few weeks and be effective, it is very easy to squeeze out a lot of performance.

* built-in profiler. * built-in escape analysis tool. * It's easy to pass pointers instead of copying data. * []byte is sub-slice-able, with a backing array. This does throw people off occasionally, but the trade off is performance. * Go lets you have real arrays of structs, optimizing cpu caches. * Built-in memory pools

And more.

And if you look at "non-idiomatic" performance code, they are surprisingly legible by the said fresh engineer. It's as if the designers didn't want to give up all the usual C performance tricks while making a Java/Python kind of friendly language, and this shows.

Of course Go can go only so far, due to the built-in runtime and GC. But it gets very far. Much farther than at first glance, or second glances that language snobs would give credit for.

kosherhurricane commented on Some Mexican pharmacies are selling full bottles of Adderall. But it's meth   latimes.com/world-nation/... · Posted by u/Aloha
thaumasiotes · 2 years ago
> The analogy is that they are both alcohol so they are the same right? Obviously not.

They are the same. The difference is just that the bottle sold as "rubbing alcohol" has been intentionally poisoned.

kosherhurricane · 2 years ago
Rubbing alcohol is isopropanol. Drinking alcohol is ethanol.

You can get “industrial ethanol” that has some methanol added to prevent people from consuming it, and pay liquor tax on it. These are for chemists for specific applications.

None of these things are “the same”.

kosherhurricane commented on Why is Debian the way it is?   blog.liw.fi/posts/2023/de... · Posted by u/brycewray
abdullahkhalids · 2 years ago
From the description, the Debian organization seems to be an anarchist one. A bunch of people, not coerced to be there, have created a diffuse rotating democracy for making decisions. Self-sufficiency is key to the organization, that emerges from thoughtful usage of resources.
kosherhurricane · 2 years ago
Why would you consider an organization with a constitution anarchist?
kosherhurricane commented on More than 75,000 Kaiser workers go on strike in clash with over wages   latimes.com/california/st... · Posted by u/PaulHoule
boeingUH60 · 2 years ago
Kaiser 2022 revenue; $68 billion. Net income; $925 million. CEO pay; $13.3 million base and $2.3 million "Other." [1]

Kaiser Foundation Health Plan and Kaiser Foundation Hospitals earned a combined $100 billion in revenue in 2021 [2]. It's the highest-grossing non-profit organization in the USA and probably the world, lol...net income margins are slim though.

1- https://projects.propublica.org/nonprofits/organizations/941.... 2- https://projects.propublica.org/nonprofits/states/CA

kosherhurricane · 2 years ago
Kaiser is non profit. They dont have shareholders and no dividends. The 1B net income that year is because some years they run a deficit.

If the workers get paid more through this strike, it will translates directly to higher prices.

Even after that, Kaiser will stay a low cost provider. Becasue they are non-profit.

kosherhurricane commented on Ask HN: Will Google delete inactive gmail accounts that forward email?    · Posted by u/tikkun
kosherhurricane · 2 years ago
The way I read their deletion terms, if you have some money in the account's Play Store Balancee (say by depositing a $10 gift card), they won't delete those accounts.
kosherhurricane commented on Error Handling in Zig   aolium.com/karlseguin/401... · Posted by u/nalgeon
grumpyprole · 2 years ago
Go's lack of sum types mean that there is no static check for whether the error has actually been handled or not. Go's designers went to all the trouble of having a static type system, but then failed to properly reap the benefits. Sum types are the mathematical dual of product types. It makes sense for any modern language to include them.
kosherhurricane · 2 years ago
> Go's lack of sum types mean that there is no static check for whether the error has actually been handled or not.

I dunno, my IntelliJ calls out unhandled errors. I imagine go-vet does as well.

kosherhurricane commented on Error Handling in Zig   aolium.com/karlseguin/401... · Posted by u/nalgeon
valenterry · 2 years ago
I find this to be a good example where a language with well defined "foundations" can really shine.

If a programming language supports union types and type inference then there is no need for such a "special" language feature as described here. The return type will simply have the form "goodresult | error" and the compiler will infer it based on the function-body alone.

At the same time, the following problem of zig is automatically a non-issue:

> A serious challenge with Zig's simple approach to errors that our errors are nothing more than enum values.

If the result is "goodresult | error" then I can choose of what type "error" is and I'm not bound to any predefined types that the language forces upon me.

In fact, the article then shows how to work around the issue with a tagged union. The problem is that this creates another issue: the composition of different error types.

E.g. having function foo calling bar and baz and bar can fail with barError and baz can fail with bazError. Then, without having to do anything, the compiler should infer that foo's return type should be "goodresult | barError | bazError". This won't work if tagged unions are used like in the example - they will have to be mapped by hand all the time, creating a lot of noise.

While Zig's errorhandling is not bad and miles above Go's, it makes me sad to see that we still lack ergonomy of errorhandling in so many languages despite knowing pretty much all of the language-features that are necessary to make it much easier.

kosherhurricane · 2 years ago
> If a programming language supports union types and type inference then there is no need for such a "special" language feature

Laughs in Go.

> While Zig's errorhandling is not bad and miles above Go's

Laughs again in Go. Go has no "foundations" regarding errors, it's just a convention. It has no union types. It doesn't have weird corner cases. It's just a returned value you can handle. Or not.

Of all the error handling paradigms I've seen, Go's requires the least amount of "specialized thinking" (try/catch or whatnot)--it's just becomes another variable.

kosherhurricane commented on Case study: fake hardware cryptowallet   kaspersky.com/blog/fake-t... · Posted by u/freerk
kosherhurricane · 2 years ago
My #1 argument against the feasibility of cryptocurrency: Can my parents not their get money stolen?

Deleted Comment

u/kosherhurricane

KarmaCake day157April 19, 2022View Original