agentleFS
guojin-yanguojin-yan/DeploySharp/.agents/skills/deploysharp-performance-analysis/SKILL.md

deploysharp-performance-analysis

Skill179 starsChanged 12 days agoApache-2.0View on GitHub

Benchmark and optimize DeploySharp preprocessing, inference, decoding, batching, Session pools, memory copies, and allocations. Use for latency, throughput, P50/P95, CPU/GPU utilization, or regression investigations.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Remove repeated decode, resize, normalization, tensor copies, LINQ materialization, and per-call large allocations.

    line 18
  2. Distinctive:

    Use true model Batch when the graph and decoder support row isolation.

    line 20
  3. Distinctive:

    Keep GPU data resident only when the backend contract and result validation support it.

    line 22
  4. Very specific:

    Use tools/DeploySharp.VisualBenchmark and tools/DeploySharp.PaddleOcrBenchmark where applicable.

    line 28

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

DeploySharp Performance Analysis

Performance work must preserve the result contract. Establish correctness and a repeatable baseline before changing copies, buffers, batching, threads, streams, or decoder algorithms.

Measure The Right Boundary

Report cold/end-to-end and steady separately. Split image decode, preprocessing, host-to-device transfer, backend execution, device-to-host transfer, decoder/postprocessing, merge, and total wall time. For OCR, measure the complete det -> crop -> cls/orientation -> rec -> merge pipeline and record the selected recognition Batch and independent Session count.

Use at least 5 warm-ups and 50 measured calls for a formal row. Compute mean, P50, P95, minimum, maximum, allocations, peak process memory, and GPU memory from raw samples. Record model/input/engine SHA-256, source revision, runtime versions, power policy, clocks or Boost state, precision, shape/profile, Batch, Sessions, streams, and input reuse.

Optimization Priorities

  1. Remove repeated decode, resize, normalization, tensor copies, LINQ materialization, and per-call large allocations.
  2. Reuse bounded buffers and prepared inputs without allowing mutable state to escape its owner.
  3. Use true model Batch when the graph and decoder support row isolation; otherwise use a bounded pool of independently created Sessions.
  4. Overlap preparation of the next frame with current inference through bounded prefetch. Avoid unbounded Task.Run queues.
  5. Keep GPU data resident only when the backend contract and result validation support it; retain a tested CPU fallback.

Judge changes by correctness, P50/P95, throughput, allocations, and memory together. A lower mean with worse P95 or unbounded memory is not a general improvement.

Repository Outputs

Use tools/DeploySharp.VisualBenchmark and tools/DeploySharp.PaddleOcrBenchmark where applicable. Write raw results to a caller-owned directory outside Git. Update docs/articles/device-performance-benchmarks.md only with concise, comparable summaries; do not commit machine logs or one-off reports.

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.