Experience with ePaxos: Systems Research using Go
da-data.blogspot.com
da-data.blogspot.com
Ie I wrote a random forest implementation [1] and i've been able to quickly add in a bunch of different published and experimental variations on the algorithm as needed for the data sets I work on.
> Evaluated using prototypes of protocols in Go
Retarded. This is why I left academia.
As soon as I read "has no designated leader" I stopped reading and skimmed through to make sure safety and liveness proofs were in there somewhere before I spent any significant time reading the rest.
This feels like it's probably a nice advancement over S-Paxos and I'm looking forward to getting through it -- thanks for making it accessible.
Also, this is awesome: "Copyright is held by the Owner/Author(s)"
(For the non-academics: SIGOPS is the chapter of the ACM for operating systems. It runs SOSP and similar things.)
But to the original questioner, yes, we should put the TLA+ spec online instead of requiring someone to copy/paste from the tech report... please hold. :)
> Getting the performance variation down was a little tricky. In several spots, we had to think carefully (and experiment with some dead-ends) about how to reduce the amount of garbage we were generating.
They do say it was worth it in the end, and that other languages would have similar drawbacks.
Achieving high performance on a single machine and building reusable data structure libraries is easier in C++. Things like vectorization, cache-optimized layouts, etc., are all more easy here (or just in C).
More on (): We found it incredibly important for the performance of our system to prioritize processing of existing requests over processing new request arrivals - up to a point. Making progress on an existing request helps reduce the number of goroutines/objects/etc. that're processing, so that everything runs faster. But you don't want to go too far or you starve for work. The key here was to think about it instead of letting your design happen to you.
The most important is already known: Profile, don't guess. The profiling Go article is a good start.
Profile first, always.
Could you explain a bit more about this features of C++? I believe that you're referring to templates for the first point, but I'm unsure about the rest - SIMD? stack-allocation/memory-pool-allocation?
gcc can sometimes emit SIMD code for you, without having to think about it. If you need to go farther, it's easy to use something like ispc to write vectorized code and link it into your program. It's more work to take advantage of hyper-optimized C from Go.
Cache-optimized layouts: Not where it comes from, but things like forcing a structure to be aligned on a 64-byte (cache line) or 4096 (page) boundary, in order to, e.g., eliminate false sharing between threads. It's harder to micromanage the memory layout in Go while retaining its safety benefits and native datatypes.
Finally, gcc havs more CPU-specific builtins such as __builtin_prefetch(), which let you have even more control over what data goes into what level of the cache (or doesn't).
I'm interested in compiler development, so this kind of information is really valuable for me... Do you think something similar was achievable in Go, if you had thing like vectors (i.e. fixed-length numerical arrays that would have math-like semantics, and which would compile to SIMD), prefetch attributes/instructions for heap-allocated variables, and memory-alignment attributes for structs or even for specific heap allocations?