Skip to content

Instantly share code, notes, and snippets.

View Logmos's full-sized avatar
🌴
On vacation

Logmos

🌴
On vacation
View GitHub Profile
@Logmos
Logmos / latency.markdown
Created April 3, 2019 08:42 — 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

@Logmos
Logmos / RamerDouglasPeucker.cpp
Created March 5, 2019 01:45 — forked from TimSC/RamerDouglasPeucker.cpp
2D implementation of the Ramer-Douglas-Peucker algorithm in C++
//2D implementation of the Ramer-Douglas-Peucker algorithm
//By Tim Sheerman-Chase, 2016
//Released under CC0
//https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm
#include <iostream>
#include <cmath>
#include <utility>
#include <vector>
#include <stdexcept>
@Logmos
Logmos / gdbinit
Last active December 22, 2018 08:47
.gdbinit - A user-friendly gdb configuration file
# INSTALL INSTRUCTIONS: save as ~/.gdbinit
#
# DESCRIPTION: A user-friendly gdb configuration file.
#
# REVISION : 7.3 (16/04/2010)
#
# CONTRIBUTORS: mammon_, elaine, pusillus, mong, zhang le, l0kit,
# truthix the cyberpunk, fG!, gln
#
# FEEDBACK: https://www.reverse-engineering.net