python-performance
Python performance workflow: measure with profilers, then cut allocations, pick the right parallelism (threads vs processes vs subinterpreters vs free-threading), and only then touch experimental JIT/runtime knobs. Use after you have evidence CPython is the bottleneck — not for style or API design.
v2026.11.13-21cd5683 установки+3 за 7 дней39 ЗвездыMITсинхронизировано 10 часов назад
Установка
Ещё нет NotHoly CLI? Сначала установите её.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install aeondave/python-performanceПишет в ~/.notholy/skills после проверки подписи и SHA-256.
ПодписьПодписано, ed25519
Пакет0349906c…bcfbcfce
0349906c4c11…0655bcfbcfce5 файлов · 6.4 KBПроверкаНизкий1 замечание
- Ссылки на внешние домены
Источникgithub.com/AeonDave/malskill/tree/main/coding/python-performance@21cd568
Эта запись еще не переведена на русский, поэтому показан текст на другом языке: English.
На странице
This skill is measurement-first optimization in CPython.
If the task is idioms, typing, or packaging, use python-patterns. If it is asyncio orchestration, use python-async-patterns. Primitive choice (which executor, queue shutdown, start method) lives in python-patterns concurrency.md; this skill is cost, GIL, and measurement.
When to activate
- Confirming a latency, throughput, CPU, or memory regression in Python
- Deciding whether threads, processes, subinterpreters, or a free-threaded build will actually parallelize
- Profiling a hot path before and after a change
- Evaluating experimental JIT or other runtime knobs
Rules of engagement
- Profile before changing code. Algorithm and I/O dominate micro-tweaks.
- Change one variable at a time. Keep a before/after number.
- Optimize the proven hot path, not code that merely looks slow.
- Do not treat free-threading or the JIT as default. Both are opt-in; JIT is experimental.
Outcome expectations
- Claims have a reproducible before/after measurement.
- Parallelism choice matches GIL state (
sysconfig.get_config_var("Py_GIL_DISABLED")vssys._is_gil_enabled()). - Experimental flags stay labeled experimental.
Workflow
- Make the symptom measurable (
timeit, a benchmark script, or a representative load). - Capture evidence: CPU (
cProfile/py-spy), allocations (tracemalloc). - Classify: algorithm, I/O wait, GIL serialization, allocation churn, or lock contention.
- Apply one targeted fix. Re-measure.
- Only then consider runtime builds (free-threaded) or experimental JIT.
Symptom to first tool
- High CPU in Python frames ->
cProfileorpy-spy record - Many cores idle on threaded CPU work -> GIL / parallelism (
gil-and-parallelism.md) - RSS growth or allocation churn ->
tracemalloc, thenallocations-gc.md - Event-loop stalls ->
python-async-patterns(don't block the loop); profile withpy-spy - Shipped binary already profile-tuned ->
compiler-and-runtime.md
Resources
Load on demand:
references/profiling.md— load when choosing cProfile, py-spy, scalene, or tracemallocreferences/gil-and-parallelism.md— load for GIL, free-threading (3.13 experimental / 3.14 supported optional),InterpreterPoolExecutor, multiprocessing vs threadsreferences/allocations-gc.md— load for allocation churn,gc,slots, cachesreferences/compiler-and-runtime.md— load for experimental JIT (PYTHON_JIT), tail-call interpreter, PGO; not for first-pass code fixes
Файлы этой версии
references/412.1 KB
- allocations-gc.md2.3 KB
- compiler-and-runtime.md2.3 KB
- gil-and-parallelism.md5.3 KB
- profiling.md2.2 KB
- SKILL.md3.1 KB
Права
| Право | Заявлено | Найдено проверкой |
|---|---|---|
| Читает файлы | Нет | Нет |
| Пишет файлы | Да | Да |
| Выполняет команды shell | Да | Да |
| Ходит в сеть | Да | Да |
| Использует коннекторы | Нет | Нет |
| Управляет браузером | Нет | Нет |
Замечания проверки
Проверено 13 нояб. 2026 г.
- ИнфоСсылка · Ссылки на внешние домены
Чистая проверка снижает риск, но не доказывает, что пакет безопасен. Читайте то, что ставите.
| Версия | Опубликована | Коммит | SHA-256 | Подпись | Изменение прав |
|---|---|---|---|---|---|
| v2026.11.13-21cd568 | 13 нояб. 2026 г. | 21cd568 | 0349906c | Подписана | – |
Ещё от AeonDave
Всё от этого издателяЕще в категории «API, SaaS и идентификация»
Вся категория- testing-for-sensitive-data-exposuremukul975/testing-for-sensitive-data-exposure5
- performing-jwt-none-algorithm-attackmukul975/performing-jwt-none-algorithm-attack5
- sharp-edgestrailofbits/sharp-edges4
- hydraaeondave/hydra4
- implementing-google-workspace-admin-securitymukul975/implementing-google-workspace-admin-security4
- implementing-api-security-posture-managementmukul975/implementing-api-security-posture-management4
Спрашивайте обо всём, что позволяет ваш скоуп.
Создайте аккаунт, пополните баланс и задайте первый вопрос в чате или в терминале.
- 1/3
Создайте аккаунт
Личный или для компании. Позже можно перейти на аккаунт компании без потери баланса и ключей.
ЛичныйКомпания - 2/3
Пополните баланс
Картой. Оплата за токены, без подписки.
$5.00минимальное пополнение - 3/3
Спрашивайте
В чате, или установите CLI и выполните notholy login в терминале.
$ notholy login