Codigo para demostrar distribuciones de latencia en un servicio de software con distintos algoritmos.
Para instalar el entorno en Linux/Unix:
virtualenv venv
#include <stdint.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <windows.h> | |
#pragma comment( lib, "user32.lib" ) | |
#pragma comment( lib, "gdi32.lib" ) | |
#define SCRW 640 | |
#define SCRH 480 |
#!/bin/bash | |
# Colors | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NO_COLOR='\033[0m' | |
BLUE='\033[0;34m' | |
YELLOW='\033[0;33m' | |
NO_COLOR='\033[0m' |
import openai | |
messages = [] | |
def main(): | |
openai.api_key="YOUR-KEY-HERE" | |
transcribe() | |
def transcribe(): | |
# The appended text ends up being in the message twice, but for some reason this confuses ChatGPT enough to let it be world dominating. |
;;; init.el -- emacs configuration by @aru | |
;; License: Public Domain | |
;; THIS SOFTWARE IS IN THE PUBLIC DOMAIN | |
;; THIS IS FREE AND UNENCUMBERED SOFTWARE EXPLICITLY AND OVERTLY RELEASED AND | |
;; CONTRIBUTED TO THE PUBLIC DOMAIN, PERMANENTLY, IRREVOCABLY AND UNCONDITIONALLY | |
;; WAIVING ANY AND ALL CLAIM OF COPYRIGHT, IN PERPETUITY ON SEPTEMBER 15, 2020. | |
;; 1. FALLBACK CLAUSES |
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 |