mcpField
I
io-bound-data-processing

io-bound-data-processing

github.com/pproencaData & databases218121 installsUpdated 11w ago
Repository

About io-bound-data-processing

A reference skill for engineers processing datasets larger than memory on a single constrained machine. It covers memory discipline, I/O patterns, formats, batching, disk spill, backpressure, concurrency, and measurement, prioritized by their impact on whether jobs complete.

Key features

  1. 01Streaming and bounded-memory processing
  2. 02Sequential and buffered I/O patterns
  3. 03Format and encoding selection
  4. 04Chunking, batching, and disk spill
  5. 05Backpressure and concurrency guidance
  6. 06Throughput and bottleneck measurement

Use cases

  1. 01Prevent OOM on datasets larger than RAM
  2. 02Speed up slow file or network pipelines
  3. 03Choose chunk sizes within a memory budget
  4. 04Diagnose I/O-bound jobs on small machines

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill io-bound-data-processing

After installing, type/io-bound-data-processingin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
batch-coalesce-writes-with-buffered-output.md
batch-keyset-pagination-over-offset.md
batch-pick-chunk-size-by-memory-budget.md
batch-process-with-stable-iterators.md
batch-use-vectorized-apis-not-row-loops.md
codec-dictionary-encoding-for-repetitive-strings.md
codec-prefer-binary-protocols-over-json-for-rpc.md
codec-train-a-zstd-dictionary-for-many-small-payloads.md
codec-zstd-or-lz4-as-defaults-not-gzip.md
conc-asyncio-for-many-network-streams-not-for-cpu.md
conc-overlap-compute-with-prefetch.md
conc-thread-pools-for-blocking-io-libraries.md
conc-tune-parallelism-to-the-bottleneck.md
fmt-avoid-deeply-nested-json-for-hot-paths.md
fmt-columnar-for-analytical-scans.md
fmt-line-delimited-for-streaming-row-ingest.md
fmt-prefer-schema-on-write-when-possible.md
fmt-push-predicates-into-the-reader.md
io-async-for-many-concurrent-streams.md
io-batch-and-pipeline-network-roundtrips.md
io-buffer-explicitly-for-small-records.md
io-mmap-for-random-or-shared-large-files.md
io-prefer-sequential-over-random.md
io-stream-http-bodies-with-iter-content.md
io-zero-copy-when-moving-bytes-as-is.md
mem-bound-the-working-set.md

Details

From the project README

Community I/O-bound data processing on constrained resources Best Practices

A reference for engineers processing datasets larger than RAM on a single low-compute box. Organized by execution-lifecycle impact: rules near the top of the table govern whether the job runs at all; rules near the bottom shave the last 10 %. Optimize from the top of the waterfall.

Scope: the patterns that show up in real ETL / data-engineering / batch work on a laptop, a 2-vCPU container, or a Raspberry Pi-class node — streaming, formats, chunking, spill, backpressure, codecs, and the concurrency model that actually matches an I/O-bound bottleneck. Out of scope (covered elsewhere): the algorithmic primitives themselves (see computer-science-algorithms), distributed compute beyond a single box (use Spark/Dask), and database-engine internals (see official docs).

Distilled from Apache Arrow / Parquet docs, Polars User Guide, DuckDB docs, pandas — Scaling to large datasets, Linux man pages (mmap(2), sendfile(2), posix_fadvise(2)), Brendan Gregg's USE method and Systems Performance, Kleppmann's Designing Data-Intensive Applications, and the zstd / lz4 reference benchmarks.

When to Apply

Reach for these rules when:

  • A job OOM-kills, swaps, or runs much slower than expected on a small box
  • Input is larger than RAM and you need to scan, filter, aggregate, sort, or join it
  • A pipeline has unbounded buffers between stages, or memory grows linearly during a "streaming" job
  • You see one-row-per-RTT writes (INSERT per row, requests.get per URL, f.read(32) per record)
  • You're picking a format/codec/serializer and the choice matters at scale
  • A top shows low CPU and high iowait, or you don't know which it is
  • "It's slow but I don't know why" — start at the obs- category

Rule Categories By Priority

#CategoryPrefixImpactWhy it cascades
1Memory Disciplinemem-CRITICALSlurping into RAM defeats every downstream technique on a constrained box
2I/O Access Patternsio-CRITICALDisk/net are 10³–10⁶× slower than RAM; access pattern dominates wall-clock
3Data Format & Encodingfmt-HIGHFormat fixes the lower bound on I/O volume + decode cost before any logic runs
4Chunking & Batchingbatch-HIGHGranularity controls peak memory and amortizes per-item overhead
5Spill-to-Disk & External Memoryspill-HIGHWhen data > RAM, the choice is "spill cleanly" or "OOM"
6Pipelining & Backpressurepipe-MEDIUM-HIGHUnbounded buffers between fast producers and slow sinks = OOM
7Compression & Serializationcodec-MEDIUMTrades CPU for I/O; right codec saves orders of magnitude
8Concurrency for I/O-Bound Workloadsconc-MEDIUMAsync / threads / processes are different tools; wrong model wastes CPU
9Observability & Throughput Tuningobs-LOW-MEDIUMCan't tune what you don't measure; iowait ≠ CPU-bound

Quick Reference

1. Memory Discipline (CRITICAL)
2. I/O Access Patterns (CRITICAL)
3. Data Format & Encoding (HIGH)
4. Chunking & Batching (HIGH)
5. Spill-to-Disk & External Memory (HIGH)
6. Pipelining & Backpressure (MEDIUM-HIGH)
7. Compression & Serialization (MEDIUM)
8. Concurrency for I/O-Bound Workloads (MEDIUM)
9. Observability & Throughput Tuning (LOW-MEDIUM)

How to Use

Start with the question that matches the problem:

Code examples are in Python (most readable across audiences). The reasoning generalizes — equivalent libraries in other ecosystems (Arrow C++/Rust/Java, Polars Rust, DuckDB everywhere, libuv-style async) follow the same patterns.

Reference Files

FileDescription
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for adding new rules
metadata.jsonVersion and reference information
AGENTS.mdAuto-built TOC navigation

Related Skills

  • computer-science-algorithms — Algorithmic primitives this skill builds on (external merge sort, sketches, hash partitioning, sampling)

Comments

Markdown supported