con un clic
performant-code
Writing efficient code that handles large data and tight constraints
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Writing efficient code that handles large data and tight constraints
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Basado en la clasificación ocupacional SOC
Building, compiling, and resolving dependency issues across languages
Systematic code review for bugs, security, style, and performance
Working with diverse data formats: binary, text, structured, and custom
Systematic exploration of unknown environments before starting work
Git operations: commits, branches, PRs, and conflict resolution
Refactor code to improve structure and maintainability
| name | performant-code |
| description | Writing efficient code that handles large data and tight constraints |
| tags | ["performance","optimization","benchmark"] |
| version | 1.0.0 |
How to write code that won't timeout on large inputs.
Before writing code, ask: how big is the data?
| Data size | Approach |
|---|---|
| < 1 MB | Load into memory, any approach works |
| 1-100 MB | Load into memory, but use efficient algorithms |
| 100 MB - 1 GB | Stream/mmap, avoid loading entirely into memory |
| > 1 GB | Streaming only, chunk-based processing |
mmap(), Python: mmap.mmap()) — map file into memory, OS handles pagingfread() in C, open(f, 'rb').read(chunk) in Pythonfgets() when you need random accesswrite() for every bytefwrite() or sys.stdout.buffer.write() for binary outputmmap() for large file access-O2 or -O3 for compiler optimizationsmalloc()/free() in tight loops — pre-allocatememcpy() instead of byte-by-byte copyingnumpy for numerical work (100x faster than pure Python loops)collections.Counter, defaultdict — avoid manual countingstruct.unpack() for binary parsingsubprocess.run() > os.system()wc -c