From bc26676e5978ab445ea613ffe85f3c88af5186aa Mon Sep 17 00:00:00 2001 From: goodboy Date: Sat, 31 Jan 2026 03:18:08 -0500 Subject: [PATCH] Add `.claude/skills/*` files from gap-annotator perf sesh with ma boi --- .claude/skills/piker_profiling.md | 384 +++++++++++++++ .../piker_slang_and_communication_style.md | 410 ++++++++++++++++ .../pyqtgraph_rendering_optimization.md | 239 +++++++++ .../timeseries_numpy_polars_optimization.md | 456 ++++++++++++++++++ 4 files changed, 1489 insertions(+) create mode 100644 .claude/skills/piker_profiling.md create mode 100644 .claude/skills/piker_slang_and_communication_style.md create mode 100644 .claude/skills/pyqtgraph_rendering_optimization.md create mode 100644 .claude/skills/timeseries_numpy_polars_optimization.md diff --git a/.claude/skills/piker_profiling.md b/.claude/skills/piker_profiling.md new file mode 100644 index 00000000..5e6bacac --- /dev/null +++ b/.claude/skills/piker_profiling.md @@ -0,0 +1,384 @@ +# Piker Profiling Subsystem Skill + +Skill for using `piker.toolz.profile.Profiler` to measure +performance across distributed actor systems. + +## Core Profiler API + +### Basic Usage + +```python +from piker.toolz.profile import ( + Profiler, + pg_profile_enabled, + ms_slower_then, +) + +profiler = Profiler( + msg='', + disabled=False, # IMPORTANT: enable explicitly! + ms_threshold=0.0, # show all timings, not just slow +) + +# do work +some_operation() +profiler('step 1 complete') + +# more work +another_operation() +profiler('step 2 complete') + +# prints on exit: +# > Entering +# step 1 complete: 12.34, tot:12.34 +# step 2 complete: 56.78, tot:69.12 +# < Exiting , total: 69.12 ms +``` + +### Default Behavior Gotcha + +**CRITICAL:** Profiler is disabled by default in many contexts! + +```python +# BAD: might not print anything! +profiler = Profiler(msg='my operation') + +# GOOD: explicit enable +profiler = Profiler( + msg='my operation', + disabled=False, # force enable! + ms_threshold=0.0, # show all steps +) +``` + +### Profiler Output Format + +``` +> Entering +