Skip to content

Instantly share code, notes, and snippets.

View chaelim's full-sized avatar

C.S. Lim chaelim

View GitHub Profile
@cmer
cmer / gist:1566734
Created January 5, 2012 19:16
UnixBench comparison of EC2 and Joe's Data Center
apt-get install -y build-essential libx11-dev libgl1-mesa-dev libxext-dev perl perl-modules make
cd /tmp
wget http://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
tar xzvf UnixBench5.1.3.tgz
cd UnixBench
./Run
@msackman
msackman / QueueingConsumerCoDel.java
Created May 11, 2012 10:00
QueueingConsumer extended with the CoDel algorithm
// The contents of this file are subject to the Mozilla Public License
// Version 1.1 (the "License"); you may not use this file except in
// compliance with the License. You may obtain a copy of the License
// at http://www.mozilla.org/MPL/
//
// Software distributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
// the License for the specific language governing rights and
// limitations under the License.
//
@jboner
jboner / latency.txt
Last active November 18, 2024 08:23
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@j3tm0t0
j3tm0t0 / Upload2Glacier.ps1
Created August 21, 2012 09:11
Upload a file to Glacier PowerShell script version
Add-Type -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll"
$region="ap-northeast-1"
$accesskey="ACCESSKEY"
$secretkey="SECRETKEY"
$vaultname="myvault"
$description="some binary file"
$file="c:\hoge\target.bin"
$endpoint = [Amazon.RegionEndpoint]::GetBySystemName($region)
------- data ------ --------------------- load -------------------- - child -
keys mem clients blocked requests connections
577999 113.36M 1 0 0 (+0) 1
748999 138.92M 1 0 1 (+0) 1
922999 169.01M 1 0 2 (+1) 1
1076999 211.63M 1 0 3 (+1) 1
1216999 235.84M 1 0 4 (+1) 1
1366999 253.78M 1 0 5 (+1) 1
1520999 280.39M 1 0 6 (+1) 1
1675999 307.18M 1 0 7 (+1) 1
@ib-lundgren
ib-lundgren / github_flask_oauth2.py
Created September 10, 2013 10:53
Example of how to use Flask with requests-oauthlib to fetch a GitHub user profile using an OAuth 2 token.
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"

Plaintext 8 threads

Connections: 8		Haywire		Requests/sec:  57334.75
Connections: 8		Go		    Requests/sec:  42901.57
-------------------------------------------------------
Connections: 16		Haywire		Requests/sec:  71460.01
Connections: 16		Go		    Requests/sec:  71891.07
-------------------------------------------------------
Connections: 32		Haywire		Requests/sec:  78421.15
Connections: 32		Go		    Requests/sec:  89202.96

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing