Skip to content

Instantly share code, notes, and snippets.

View jiaguofang's full-sized avatar

Jiaguo Fang jiaguofang

  • Uber
  • San Francisco, CA
View GitHub Profile
@gsakkis
gsakkis / benchmark.py
Created October 3, 2011 21:36
Slope One
import sys, csv, time
from collections import defaultdict
from itertools import islice
import orig_slopeone, slopeone, numpy_slopeone
classes = [
orig_slopeone.SlopeOne,
#orig_slopeone.SlopeOneNumpy, # XXX: dog slow
slopeone.SlopeOne,
@jboner
jboner / latency.txt
Last active July 25, 2024 11:30
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
@unsuthee
unsuthee / skiplist.h
Created November 20, 2012 08:00
C++ Implementation of Skiplist
///////////////////////////////////////////////////////////////////////////////
#ifndef _SKIPLIST_H_
#define _SKIPLIST_H_
#include <iostream>
#include <sstream>
///////////////////////////////////////////////////////////////////////////////
@jkreps
jkreps / benchmark-commands.txt
Last active June 17, 2024 03:54
Kafka Benchmark Commands
Producer
Setup
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test-rep-one --partitions 6 --replication-factor 1
bin/kafka-topics.sh --zookeeper esv4-hcl197.grid.linkedin.com:2181 --create --topic test --partitions 6 --replication-factor 3
Single thread, no replication
bin/kafka-run-class.sh org.apache.kafka.clients.tools.ProducerPerformance test7 50000000 100 -1 acks=1 bootstrap.servers=esv4-hcl198.grid.linkedin.com:9092 buffer.memory=67108864 batch.size=8196