Skip to content

Instantly share code, notes, and snippets.

@Jxrgxn
Jxrgxn / latency.markdown
Last active August 29, 2015 14:27 — forked from hellerbarde/latency.markdown
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

@Jxrgxn
Jxrgxn / CGRect+Additions.swift
Created February 5, 2016 10:41 — forked from codyrobb/CGRect+Additions.swift
CGRect Alignment Extension
//
// CGGeometry+Additions.swift
// TokenField
//
// Created by Cody Robertson on 2/4/16.
// Copyright © 2016 Notion AI, Inc. All rights reserved.
//
import Foundation
import UIKit
#!/bin/bash
set -e
trap "exit;" SIGINT SIGTERM
ALIAS=mxcl
VERSION="3.0.0-${ALIAS}+$(date +%Y%m%d)"
SRCROOT="$HOME/src"
TOOLCHAIN_NAME="swift-${VERSION}.xctoolchain"
TOOLCHAIN_PREFIX="${SRCROOT}/build/${TOOLCHAIN_NAME}"
@Jxrgxn
Jxrgxn / gist:c0ba8cdabf4705f798749d721f2fa172
Created June 30, 2016 20:45 — forked from abury/gist:1404051
Simple iOS Build Script
#!/bin/sh
# Simple iOS build script
# Written by Aron Bury, 29/11/2011
appname="AwesomeApp"
target_name="$appname"
sdk="iphoneos"
certificate="iPhone Developer: Joe Blogs"