Skip to content

Instantly share code, notes, and snippets.

View v0i0's full-sized avatar

Markus Hoehnerbach v0i0

  • Nvidia
  • California
View GitHub Profile
@mmozeiko
mmozeiko / ctime.c
Last active November 7, 2023 14:45
ctime.c
/* ========================================================================
$File: tools/ctime/ctime.c $
$Date: 2016/05/08 04:16:55PM $
$Revision: 7 $
$Creator: Casey Muratori $
$Notice:
The author of this software MAKES NO WARRANTY as to the RELIABILITY,
SUITABILITY, or USABILITY of this software. USE IT AT YOUR OWN RISK.
@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@amadio
amadio / simd-filtering-avx2.cc
Last active June 15, 2021 01:12
SIMD data filtering example with AVX2
#include <chrono>
#include <cstdio>
#include <cstdint>
#include <cstring>
#include <cstdlib>
#include <malloc.h>
#include <x86intrin.h>
class StopWatch {
public:
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@davidad
davidad / asmrepl.lua
Created March 1, 2014 12:08
Abusing LuaJIT as a REPL for assembly language
-- warning: this is hacky. run at your own risk.
--
-- before you run this, put sum_list.asm in a dynamic library.
--
-- on OSX that means
-- $ nasm -f macho64 sum_list.asm
-- $ libtool -dynamic sum_list.o -o libsum_list.dylib
--
-- on Linux it means
-- $ nasm -f elf64 sum_list.asm
@naiquevin
naiquevin / thankyou.py
Last active September 16, 2020 16:09
Python script to thank people who sent birthday wishes on facebook
import sys
from urllib import urlencode
import requests
from urlparse import urlparse, parse_qs
from random import choice
import re
self_id = None # your facebook id here
utc_bday = None # utc timestamp of your birthday
@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

@jboner
jboner / latency.txt
Last active May 6, 2024 07:06
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