Skip to content

Instantly share code, notes, and snippets.

View jayv's full-sized avatar

Jo Voordeckers jayv

View GitHub Profile
@sgielen
sgielen / CMakeLists.txt
Created February 5, 2017 11:39
Building kernel with CMake, clang and binutils ld
cmake_minimum_required(VERSION 2.8.12)
project(MyKernel C CXX ASM)
# ...
add_executable(mykernel boot.s kernel_main.cpp) # + other source files
set_target_properties(mykernel PROPERTIES LINK_DEPENDS "${CMAKE_SOURCE_DIR}/linker.ld")
set_target_properties(mykernel PROPERTIES LINK_FLAGS "-T ${CMAKE_SOURCE_DIR}/linker.ld")
@jayv
jayv / shl.sh
Created October 30, 2015 18:48
Syntax highlighting code on the clipboard to RTF colored and formatted to paste into Keynote
pbpaste | highlight -O rtf /dev/stdin --font-size 34 --font Menlo --style molokai -W -J 80 -j 3 --src-lang java | pbcopy
@jboner
jboner / latency.txt
Last active May 22, 2025 22:44
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