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
/* | |
* Load external modules and init variables | |
*/ | |
var twitter = require('ntwitter'), | |
http = require('http'), | |
bitly = require('bitly'), | |
b = new bitly('USER', 'API_KEY'), | |
tweeted = {}, | |
load_time = Math.round(new Date().getTime() / 1000), | |
score_threshold = 100; |
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
interface IVehicle | |
{ | |
String Drive(); | |
} |
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
class Roadster : IVehicle | |
{ | |
private String _Make = "Tesla Motors, Inc."; | |
public String Drive() | |
{ | |
return "Varoom Varoom"; | |
} | |
public String GetMake() | |
{ |
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
static void Main(string[] args) | |
{ | |
//1. Implementing a Roadster with an IVehicle. | |
IVehicle aVehicle = new Roadster(); | |
String startDriving = aVehicle.Drive(); | |
Console.WriteLine("All vehicles are made to drive... "+ startDriving); | |
//2. Implementing a Roadster with its concrete class. | |
Roadster aTeslaRoadster = new Roadster(); | |
aTeslaRoadster.Drive(); |
Revised date: 07/11/2012
Between us [company name] and you [customer name]
We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.
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
Choose a ticket class: <select id="tickets"></select> | |
<p id="ticketOutput"></p> | |
<script id="ticketTemplate" type="text/x-jquery-tmpl"> | |
{{if chosenTicket}} | |
You have chosen <b>${ chosenTicket().name }</b> | |
($${ chosenTicket().price }) | |
<button data-bind="click: resetTicket">Clear</button> | |
{{/if}} |
This is companion code to this guide.
Launch the instance and connect with ssh.
##Update the server
sudo yum update
##Install php and MySQL packages
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
#!/usr/bin/env python2.7 | |
import time | |
_URL = 'http://localhost/tmp/derp.html' | |
_NUMBER = 1000 | |
def test_urllib2(): | |
import urllib2 |