I'm glad they found a good solution (rust) to solve their problem! Also note this was with Go1.9. I know GC work was ongoing during that time, I wonder if this time of situation would still happen?
Why Discord is switching from Go to Rust
111–120 of 670 posts
Re: Why Discord is switching from Go to Rust
#112EDIT: Currently at -4 downvotes. Would downvoters care to discuss their votes?
Re: Why Discord is switching from Go to Rust
#113Earlier quoted context omitted.
Python chose spaces a la PEP8 by the way.
PEP8 isn't a language requirement, but a style guide. There are tools to enforce style on Python, but the language itself does not.
See:
https://stackoverflow.com/questions/19094704/indentation-in-...
Re: Why Discord is switching from Go to Rust
#114Earlier quoted context omitted.
Seems like Go is more suitable for the “spin up, spin down, never let the GC run” kind of scenario that is being pushed by products like AWS Lambda and other function as a service frameworks.
Why do you think it is? Go has a really great gc which mostly runs in parallel to your program with gc stops only in the doman of less than milliseconds. Discord ran into a corner case where they did not create enough garbage to trigger gc cycles, but had a performance impact due to scheduled gc cycles for returning memory to the OS (which they wouldn't need to do either).
Re: Why Discord is switching from Go to Rust
#115Earlier quoted context omitted.
We originally cached this data with a Redis cluster but we hit scaling issues. The Read States service only exists because Redis had issues.
Hah, well now I feel like a dufus. Good info!
Re: Why Discord is switching from Go to Rust
#116Earlier quoted context omitted.
With recent Go releases, GC pauses have become neglible for most applications. So this should not get into your way. However, it can easily tweaked, if needed. There is runtime.ForceGCPeriod, which is a pointer to the forcegcperiod variable. A Go program, which really needs to change this, can do it, but most programs shouldn't require this. Also, it is almost trivial to edit the Go sources (they are included in the…
runtime.ForceGCPeriod is only exported in testing, so you wouldn't be able to use it in production. But as you said, the distribution could easily be modified to fit their needs.
Re: Why Discord is switching from Go to Rust
#117Re: Why Discord is switching from Go to Rust
#118> After digging through the Go source code, we learned that Go will force a garbage collection run every 2 minutes at minimum. In other words, if garbage collection has not run for 2 minutes, regardless of heap growth, go will still force a garbage collection. > We figured we could tune the garbage collector to happen more often in order to prevent large spikes, so we implemented an endpoint on the service to change…
Re: Why Discord is switching from Go to Rust
#119Re: Why Discord is switching from Go to Rust
#120These kinds of posts would be much more interesting if they discussed alternatives considered and rejected. For example why did they choose Rust over C++?