ShopperCove
Menu
All writingBlogTopicsCategoriesAboutRSS
Blog
Categories
Observability & SRE62All categories
About

Category

Observability & SRE

Metrics, traces, percentiles and what the graphs actually say.

62 posts

Plate 68

gc.collect Cost Empty vs Cycles: Localhost Lab

Hands-on gc.collect cost empty vs cyclic garbage lab: real collect latency plus reclaim counts, measured on Linux localhost today in this lab for SREs.

Observability & SREHands-on1 Oct 2026 · 4 min

Plate 28

sqlite3 vs shelve Local KV: Localhost Lab

Hands-on sqlite3 vs shelve local KV store lab: real insert/get ops/s plus file sizes, measured on Linux localhost today in this hands-on lab for SREs.

Observability & SREHands-on1 Oct 2026 · 4 min

Plate 16

ExitStack vs Nested with Resources: Localhost Lab

Hands-on contextlib.ExitStack vs nested with and manual close: real cycles/s for N resources, measured on Linux localhost in this hands-on lab for SREs.

Observability & SREHands-on1 Oct 2026 · 3 min

Plate 40

itertools.batched vs Manual Chunking: Localhost Lab

Hands-on itertools.batched vs manual list-slice chunking: real items/s batching sequences, measured on Linux localhost today in this hands-on lab for SREs.

Observability & SREHands-on1 Oct 2026 · 3 min

Plate 12

islice vs list Slice Windows: Localhost Lab

Hands-on itertools.islice vs list slice window lab: real ops/s taking ranges from sequences, measured on Linux localhost in this hands-on lab for SREs.

Observability & SRELab1 Oct 2026 · 4 min

Plate 07

heapq.merge vs sorted(chain): Localhost Lab

Hands-on heapq.merge vs sorted(chain) multi-way merge: real records/s on pre-sorted lists, measured on Linux localhost today in this hands-on lab for SREs.

Observability & SRELab1 Oct 2026 · 4 min

Plate 88

mmap Write vs pwrite Region: Localhost Lab

Hands-on mmap MAP_SHARED write+msync vs pwrite region update: real MB/s with durability labels, measured on Linux localhost in this hands-on lab for SREs.

Observability & SRELab1 Oct 2026 · 4 min

Plate 58

os.stat vs Path.stat vs lstat: Localhost Lab

Hands-on os.stat vs pathlib.Path.stat vs os.lstat: real metadata stats/s on many regular files, measured on Linux localhost in this hands-on lab for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 71

html.escape vs Manual Replace: Localhost Lab

A hands-on localhost lab comparing html.escape with chained str.replace for safe HTML escaping.

Observability & SRELab30 Sept 2026 · 4 min

Plate 35

configparser vs JSON Config Load: Localhost Lab

A hands-on localhost lab comparing configparser and json.load for nested application configuration.

Observability & SRELab30 Sept 2026 · 4 min

Plate 17

difflib vs set Ops Similarity: Localhost Lab

Hands-on difflib.SequenceMatcher vs set Jaccard token similarity: real ops/s on token lists, measured on Linux localhost in this hands-on lab for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 24

zlib vs gzip.compress Same Level: Localhost Lab

Hands-on zlib.compress vs gzip.compress same-level (6) stdlib bake-off: real MB/s and sizes, measured on Linux localhost in this hands-on lab for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 61

methodcaller vs getattr Call: Localhost Lab

Hands-on operator.methodcaller vs getattr vs direct: real calls/s invoking methods on many objects, measured on Linux localhost today in this lab for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 58

groupby vs Manual Group: Localhost Lab

Hands-on itertools.groupby vs manual dict-of-lists: real records/s grouping pre-sorted key runs, measured on Linux localhost today in this lab for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 18

fnmatch vs re Name Filter: Localhost Lab

Hands-on fnmatch.filter vs re.compile name-list filtering measured on Linux localhost.

Observability & SRELab30 Sept 2026 · 4 min

Plate 14

as_completed vs wait: Futures Localhost Lab

Hands-on concurrent.futures as_completed vs wait lab with measured completion timing on Linux localhost.

Observability & SRELab30 Sept 2026 · 4 min

Plate 84

tarfile vs zipfile Create+Extract: Localhost Lab

Hands-on tarfile vs zipfile create+extract lab: real MB/s on a mixed small-file fixture (uncompressed tar vs zip), measured on Linux localhost for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 85

scandir vs listdir vs iterdir: Localhost Lab

Hands-on os.scandir vs listdir vs Path.iterdir lab: real entries/s for names and is_file on a synthetic tree, measured on Linux localhost (lab) for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 23

textwrap.fill vs Manual Wrap: Localhost Lab

Observability & SRELab30 Sept 2026 · 4 min

Plate 09

secrets vs urandom vs getrandbits: Localhost Lab

Observability & SRELab30 Sept 2026 · 4 min

Plate 63

Decimal vs float Sum: Localhost Lab

Hands-on Decimal vs float cumulative sum lab: real ops/s plus a simple accuracy note (not financial advice), measured on Linux localhost (lab) for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 76

threading.local vs tid-dict: Localhost Lab

Hands-on threading.local vs tid-keyed dict vs module-global lab: real ops/s for per-thread state access patterns, measured on Linux localhost for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 80

Event vs Condition vs Barrier: Localhost Lab

Observability & SRELab30 Sept 2026 · 4 min

Plate 52

asyncio.gather vs TaskGroup: Localhost Lab

Observability & SRELab30 Sept 2026 · 4 min

Plate 41

hashlib md5 vs blake2b: Checksum Lab

Hands-on hashlib md5 vs blake2b vs sha1/sha256 lab: real MB/s checksum throughput for content-integrity hashing, measured on Linux localhost for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 28

glob vs rglob vs os.walk: Listing Lab

Hands-on glob.glob vs Path.rglob vs os.walk lab: real files/s for recursive file listing on a modest fixture tree, measured on Linux localhost for SREs.

Observability & SRELab30 Sept 2026 · 4 min

Plate 78

json.dumps Compact vs Indent Lab

Hands-on json.dumps separators vs indent lab: real time and byte-size tradeoffs for compact vs pretty JSON encoding, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 41

shutil.copyfile vs Manual Copy Lab

Hands-on shutil.copyfile vs manual file copy lab: real MB/s versus open/read/write and Path.read_bytes on local disk, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 22

str.translate vs replace: Scrub Lab

Hands-on str.translate vs replace vs re.sub lab: real ops/s for character delete and map scrubbing on mid-size strings, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 46

setdefault vs defaultdict: Insert Lab

Hands-on setdefault vs if-not-in vs defaultdict lab: real ops/s for list-append and counter default insert patterns, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 15

attrgetter vs getattr: Hot Loop Lab

Hands-on operator.attrgetter vs builtin getattr lab: real ops/s for extract and sort by attribute versus direct access, measured on Linux localhost only.

Observability & SRELab30 Sept 2026 · 4 min

Plate 45

Counter vs dict: Tally Lab

Hands-on collections.Counter vs dict tally lab: real ops/s for Counter.update, dict get-add, and defaultdict(int) token counting on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 82

itemgetter vs lambda: Sort Key Lab

Hands-on operator.itemgetter vs lambda sort-key lab: real ops/s for extract and list.sort on tuples, dicts, and objects, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 32

ThreadPoolExecutor vs Sequential: I/O Lab

Hands-on ThreadPoolExecutor vs sequential lab: real wall-time speedup for I/O sleep workloads plus GIL CPU contrast, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 51

itertools vs Python loops Lab

Hands-on itertools vs pure Python loops lab: chain, islice, and accumulate vs equivalent for-loops with real ops/s, measured on Linux localhost (lab).

Observability & SRELab30 Sept 2026 · 4 min

Plate 92

deque vs list: Queue FIFO Lab

Hands-on collections.deque vs list queue lab: real FIFO ops/s for append/popleft vs list.pop(0) at several prefill sizes on Linux localhost (eng lab).

Observability & SRELab30 Sept 2026 · 3 min

Plate 16

struct.pack vs to_bytes vs memoryview Lab

Benchmarking fixed-record packing with struct.pack, Struct.pack_into, int.to_bytes, and memoryview on Linux localhost.

Observability & SRELab30 Sept 2026 · 3 min

Plate 98

lru_cache hit vs miss: Cache Cost Lab

Real Linux localhost timings for functools.lru_cache hits, miss-and-insert calls, maxsize choices, and an uncached baseline.

Observability & SRELab30 Sept 2026 · 4 min

Plate 22

string concat vs join vs StringIO: Build Lab

A hands-on localhost lab comparing +=, list+join, preallocated join, and StringIO for building strings at real sizes.

Observability & SRELab30 Sept 2026 · 4 min

Plate 09

set vs frozenset vs list: Membership Lookup Lab

A hands-on localhost lab measuring set, frozenset, list, and dict-key membership across N, with the real crossover point.

Observability & SRELab30 Sept 2026 · 5 min

Plate 92

TemporaryFile vs NamedTemporaryFile Delete Modes Lab

Hands-on tempfile modes lab: TemporaryFile vs NamedTemporaryFile delete True/False vs mkstemp unlink patterns with real measured ops/s on localhost box.

Observability & SRELab30 Sept 2026 · 6 min

Plate 80

dataclass vs slots vs dict: Python Object Lab

Hands-on Python dataclass vs slots vs dict lab: instantiation and attribute ops/s plus RSS for classic, slots, dataclass, namedtuple, dict on localhost.

Observability & SRELab30 Sept 2026 · 6 min

Plate 58

Python re vs str Methods: Text Scan Throughput Lab

Hands-on Python re vs str methods lab on a 32MiB localhost corpus: count, find, line prefix, case-insensitive, and email scans with real measured MB/s.

Observability & SRELab30 Sept 2026 · 6 min

Plate 71

posix_fadvise SEQUENTIAL vs RANDOM: Read Hint Lab

Hands-on posix_fadvise SEQUENTIAL vs RANDOM vs NORMAL lab on localhost: cold and warm 256MiB reads after drop_caches with real measured p50 MB/s and RPS.

Observability & SRELab30 Sept 2026 · 6 min

Plate 33

SHA-256 vs BLAKE2b vs xxHash: Hash Throughput Lab

Hands-on SHA-256 vs BLAKE2b vs xxHash hash throughput on 64MiB buffers (SHA-1/SHA3 labeled). Real MB/s with OpenSSL and xxHash versions on the lab box.

Observability & SRELab30 Sept 2026 · 6 min

Plate 32

SQLite WAL vs DELETE Journal: Write Throughput Lab

Hands-on SQLite WAL vs DELETE vs OFF journal_mode lab: insert/update RPS (FULL/NORMAL sync), plus WAL checkpoint cost. Real p50 numbers on localhost box.

Observability & SRELab30 Sept 2026 · 6 min

Plate 71

zstd vs gzip vs lz4: Compression Throughput Lab

Hands-on zstd vs gzip vs lz4 on 64MiB payloads (real /usr text, mixed, urandom). Measured compress/decompress MB/s and ratio at default levels. No Docker.

Observability & SRELab30 Sept 2026 · 7 min

Plate 60

fsync vs fdatasync vs none: Durable Write Cost Lab

Hands-on fsync vs fdatasync vs none: per-write and every-N sync on 256B and 4KiB records. Real p50/p95 show about 100-200x durability tax on localhost

Observability & SRELab30 Sept 2026 · 7 min

Plate 57

Context-Switch Microbench: Pipe Ping-Pong Process vs Thread

Hands-on ctx-switch lab: process pipe RTT p50 3.2 us (~0.50M sw/s); thread pipe 2.85 us; Event 9.3 us; 6 hogs blow p95 to 19 us. Real numbers, no Docker.

Observability & SREHands-on30 Sept 2026 · 5 min

Plate 80

Asyncio vs Threads: I/O Concurrency Lab with Real Numbers

Hands-on asyncio vs ThreadPool lab: sleep 58.7× vs 44×; delayed TCP 13.8× vs serial; fast-echo trap loses; CPU flat. Real localhost numbers, no Docker.

Observability & SREHands-on30 Sept 2026 · 6 min

Plate 99

flock Contention Lab: Exclusive, Shared, and LOCK_NB Fail Rates

Hands-on flock lab: uncontended LOCK_EX p50 0.33 us; waiter ~50 ms hold; w8 p50 ~36 ms; LOCK_NB 99% fail; LOCK_SH ~6.7x wall. Real numbers, no Docker.

Observability & SREHands-on30 Sept 2026 · 5 min

Plate 71

OpenSSL TLS Handshake Lab: Full vs Resume on Localhost

Hands-on TLS handshake lab: Python full HS p50 TLS1.3 1.51 ms vs TLS1.2 1.20 ms (~72× TCP); openssl resume ~1.5× / 4.1×. Localhost RSA numbers, no Docker.

Observability & SREHands-on30 Sept 2026 · 5 min

Plate 30

Stdout Buffering Lab: Line vs Full vs Unbuffered (Real Numbers)

Hands-on stdout buffering lab: full buffering maximizes throughput, while line and unbuffered modes restore live visibility on pipes.

Observability & SRELab30 Sept 2026 · 5 min

Plate 25

ProcessPool vs ThreadPool: GIL CPU Lab with Real Numbers

Hands-on ProcessPool vs ThreadPool lab: pure-Python threads lose to processes, hashlib threads help, and sleep I/O favors threads.

Observability & SRELab30 Sept 2026 · 5 min

Plate 89

epoll vs select Toy: Ready-Wait Latency and the FD_SETSIZE Cliff

Hands-on epoll vs select toy: ready-wait flat ~3.5 µs (8→900 FDs); select scales 4.6→16.9 µs then hits fd≥1024 cliff. Python numbers, no Docker.

Observability & SREHands-on30 Sept 2026 · 5 min

Plate 87

sendfile vs Userspace Copy: Localhost TCP File Serve Lab

Hands-on sendfile vs read+sendall lab: 256 MiB p50 4.41 vs 2.34 GB/s (~1.9×); copy collapses at 4 KiB. Warm localhost TCP measured, no Docker.

Observability & SREHands-on30 Sept 2026 · 5 min

Plate 60

Pipe vs Tmpfile IPC: Localhost Throughput and RTT Lab

Hands-on pipe vs tmpfile IPC lab: 5.32 vs 1.51 GB/s bulk (fsync 0.57); 64 B RTT p50 3.3 us vs 70 us vs 289 us. Localhost measured, no Docker.

Observability & SRELab30 Sept 2026 · 6 min

Plate 51

TCP_NODELAY vs Nagle: Localhost Lab with Real Numbers

Hands-on TCP_NODELAY vs Nagle: 1-byte reuse 124k vs 73k RPS; 32×16B writes favor Nagle (~1.7× fewer OutSegs). Delayed-ACK mean trap on localhost.

Observability & SRELab30 Sept 2026 · 6 min

Plate 77

ulimit Soft vs Hard File Descriptors: EMFILE Lab with Real Numbers

Hands-on RLIMIT_NOFILE lab: soft=64 → EMFILE after 58 held accepts; soft=512 takes 200/200. Soft raises without root; hard does not. Real numbers.

Observability & SRELab30 Sept 2026 · 5 min

Plate 60

SO_REUSEPORT vs Single Listen: Independent Queues and ListenOverflows

Hands-on SO_REUSEPORT lab: ss shows 4 listen queues; backlog=8 flood 72% vs 62% OK; ~41% fewer ListenOverflows. Real localhost numbers, no Docker.

Observability & SRELab30 Sept 2026 · 6 min

Plate 95

TCP Listen Backlog Lab: somaxconn, ListenOverflows, and Silent Drops

Hands-on TCP backlog lab: backlog=1 + slow accept → 34/200 OK, ListenOverflows +357; backlog=128 stays 200/200. Real ss + netstat numbers.

Observability & SRELab30 Sept 2026 · 6 min

Plate 64

Unix Domain Socket vs TCP Localhost: Latency and Throughput Lab

Hands-on UDS vs TCP loopback echo: connect-per ~3× RPS (49k vs 16k); reuse ~1.3×. Real Python numbers, no Docker.

Observability & SRELab30 Sept 2026 · 6 min
All writingBlogCategoriesTopicsAboutPrivacyRSS

© 2026 ShopperCove