Skip to content

Instantly share code, notes, and snippets.

View lingster's full-sized avatar

Ling Li lingster

View GitHub Profile
@jboner
jboner / latency.txt
Last active July 16, 2024 16:04
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
@abrichr
abrichr / gpt4v.py
Last active January 29, 2024 13:04
Example usage of GPT4-V API
# from https://github.com/OpenAdaptAI/OpenAdapt/blob/44d4a55f332ef3b846933b38854372d4166fd2ea/experiments/gpt4v.py
"""Example usage of GPT4-V API.
Usage:
OPENAI_API_KEY=<your_api_key> python3 gpt4v.py \
[<path/to/image1.png>] [<path/to/image2.jpg>] [...] "text prompt"
Example: