I have some early benchmark results for our work on a high performance NATS server in Go.
Quick Summary:
We can process ~2M msgs/sec through the system, and the ingress and egress are fairly well balanced.
The basics of the architecture are intelligent buffering and IO calls, fast hashing algorithms and subject distributor/routing, and a zero-allocation hand-written protocol parser.
In addition, I used quite a bit of inlining to avoid function overhead, no use of defer, and little to no object allocation within the fast path. I will share more details and the code at a future date.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <JuceHeader.h> | |
/** | |
Silences the buffer if bad or loud values are detected in the output buffer. | |
Use this during debugging to avoid blowing out your eardrums on headphones. | |
If the output value is out of the range [-1, +1] it will be hard clipped. | |
*/ | |
inline void protectYourEars(float *buffer, int sampleCount) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package poison | |
import ( | |
"database/sql" | |
"reflect" | |
"github.com/gorilla/schema" | |
) | |
// Convertors for sql.Null* types so that they can be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
hg purge -v --all | |
./make.bash | |
env GOOS=windows ./make.bash --no-clean | |
env GOOS=windows GOARCH=386 ./make.bash --no-clean | |
env GOOS=linux ./make.bash --no-clean | |
env GOOS=linux GOARCH=amd64 ./make.bash --no-clean | |
env GOOS=linux GOARCH=386 ./make.bash --no-clean | |
env GOOS=linux GOARCH=arm ./make.bash --no-clean |