duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
/* ======================================================================== | |
$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. |
#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. |
-- 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 |
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 |
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
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 |