agentleFS
Premchand006Premchand006/AI-assistant-skills/skills/latency-critical-systems/SKILL.md

latency-critical-systems

Skill0 starsChanged 54 days agoMITView on GitHub

Optimize and verify latency-sensitive systems, packet pipelines, and streaming engines by profiling p50/p95/p99 latency, isolating hot paths, eliminating dynamic heap allocations, and preventing false sharing. Use when p95 latency, real-time throughput, jitter reduction, or cache-line alignment matters, or when eliminating unbounded blocking in high-throughput pipelines.

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use prediction-market-oracle-research, benchmark-optimization-loop and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • renepfSkill

    prediction-market-oracle-research

    Research prediction markets as data sources or oracle signals for products, agents, dashboards, and corporate decision intelligence. Use for source-grounded analysis of market-implied probabilities, caveats, and integration patterns without investment advice.

    Also in 3 projects that use this

  • renepfSkill

    benchmark-optimization-loop

    Use when the user asks to make something faster, try many variants, run recursive optimization, benchmark latency/throughput/cost, or choose the best implementation by repeated measured tests.

    Also in 4 projects that use this

  • TironFoxSkill

    agent-payment-x402

    Add x402 payment execution to AI agents — per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents need to pay for APIs, services, or other agents.

    Also in 3 projects that use this

  • arsalllsSkill

    network-config-validation

    Pre-deployment validation of Cisco IOS/IOS-XE configuration — catching missing saves, mismatched ACLs, overlapping subnets, duplicate IPs, missing route-maps, and dangerous commands before they cause outages.

    Also in 3 projects that use this

  • marcusgollSkill

    parallel-execution-optimizer

    Identify and execute independent operations in parallel for 3-5x speedup. Auto-analyzes task dependencies, groups into batches, launches parallel Task() calls. Applies to /optimize (5 checks), /ship pre-flight (5 checks), /implement (task batching), /prototype (N screens). Auto-triggers when detecting multiple independent operations in a phase.

    Also in 3 projects that use this

  • RojiosSkill

    security-bounty-hunter

    Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.

    Also in 4 projects that use this

  • +2 more from renepf

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not collapse system performance into a single "average speed" number.

    line 20
  2. Distinctive:

    Pin critical threads: Use processor affinity to bind processing threads to dedicated physical CPU cores.

    line 41
  3. Distinctive:

    Avoid claiming sub-millisecond latencies from client-side measurements without server-side validation.

    line 48

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Latency-Critical Systems Engineering

Averages hide the failures in real-time systems. A system with a 2-millisecond median latency can still experience 200-millisecond p99 latency spikes due to heap allocation locks, cache-line contention, context switches, or unbuffered I/O. Designing for latency predictability requires measuring the complete path and eliminating sources of non-deterministic delay.

source event -> ingress buffer -> worker thread -> ring buffer -> output socket

Detailed cache-line padding rules, zero-allocation memory pool patterns, and lock-free queue designs are documented in references/latency-patterns.md.

Dissecting the Metrics

Do not collapse system performance into a single "average speed" number. Track separate distributions:

  • Percentile latencies: p50, p90, p99, and max tail latency
  • Queue depth: High or growing depth signals backpressure failure upstream
  • Cache behavior: L1/L2 miss rates and false sharing invalidations
  • Allocation counters: Zero allocations on the active processing loop

Mapping the Critical Path

Trace every step from event ingestion to completion:

  1. Ingress socket or interrupt arrival
  2. Thread scheduling and context switch latency
  3. Core memory access (cache hits versus main memory fetches)
  4. Synchronization points (atomic barriers versus mutex locks)
  5. Outbound serialization and driver dispatch

Measure each segment independently with high-resolution timestamps (std::chrono::steady_clock or CPU cycle counters).

Optimization Order

  1. Remove dynamic heap allocations: Pre-allocate ring buffers, pools, and message arenas during initialization.
  2. Align data structures: Pad producer and consumer indices to separate 64-byte cache lines to eliminate false sharing.
  3. Pin critical threads: Use processor affinity to bind processing threads to dedicated physical CPU cores.
  4. Apply backpressure early: Reject or drop shedding-eligible payloads before queue depths grow unbounded.
  5. Batch non-latency-sensitive workloads: Coalesce logging, telemetry, and metrics reporting outside the critical loop.

Guardrails

  • Optimization should never bypass cryptographic verification or data validation checks.
  • Avoid claiming sub-millisecond latencies from client-side measurements without server-side validation.
  • Retain bounded queue caps to prevent memory exhaustion during sustained network bursts.

Honest limits

Software optimization cannot compensate for underlying OS kernel scheduling jitter unless running on a real-time OS (RTOS) or with PREEMPT_RT kernel extensions. Cycle-level benchmarks conducted on development hardware do not directly translate to multi-tenant cloud instances subject to noisy-neighbor virtualization stalls.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.