horse-performance-tuning

horse-performance-tuning is a skill for Claude Code, Codex from HashLoad/horse. It costs 26 tokens per session (770 once invoked), scanned A, original, MIT.

Guidance for improving the speed and memory use of applications built with Horse, a Delphi framework for HTTP servers. It focuses on reducing temporary memory allocations and streaming large responses efficiently.

In plain words
What is it for?
It helps optimize Horse request handlers, JSON responses, string building, and transfers of large JSON files or reports.
Why use it?
Repeated object creation, string copying, and loading large payloads into memory can slow down busy servers and increase memory use.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps optimize Horse request handlers, JSON responses, string building, and transfers of large JSON files or reports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hashload/horse/horse-performance-tuning
About the project

Horse is a lightweight web framework for Delphi and Lazarus programs, providing tools for building HTTP servers and APIs. It is for developers who need routing, request handling, middleware, streaming, WebSockets, and related server features in those languages. Its catalogue skills support working with the framework.

HashLoad/horse · 1,373 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add HashLoad/horse --skill horse-performance-tuning
Clone the repo
git clone --depth 1 https://github.com/HashLoad/horse

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for horse-performance-tuning

README.md
[![agentmods](https://agentmods.dev/badge/skills/hashload/horse/horse-performance-tuning/github.svg)](https://agentmods.dev/skills/hashload/horse/horse-performance-tuning)
Your own site
<a href="https://agentmods.dev/skills/hashload/horse/horse-performance-tuning"><img src="https://agentmods.dev/badge/skills/hashload/horse/horse-performance-tuning/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for horse-performance-tuning

Your own site · 80×15
<a href="https://agentmods.dev/skills/hashload/horse/horse-performance-tuning"><img src="https://agentmods.dev/badge/skills/hashload/horse/horse-performance-tuning.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 770 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00770
Opus 5 $0.00013 $0.00385
Sonnet 5 $0.00005 $0.00154
Haiku 4.5 $0.00003 $0.00077

Measured 9d ago against content hash ecd8539538b9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

horse-performance-tuning scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

doc/skills/horse-performance-tuning/SKILL.md · 69 lines

How it starts

The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Horse Performance Tuning

To exploit the raw speed and low latency of the Horse framework, write handlers that avoid CPU bottlenecks and memory allocation overhead.


1. Minimizing Heap Allocations

Memory allocations (creating objects, large arrays, or concatenating strings) require thread synchronization locks in the memory manager, which slows down concurrent execution under heavy loads.

  • Avoid Repeated JSON Parsing: If you just need to proxy or return static JSON payloads, send them as raw string strings or static stream resources rather than creating and destroying TJSONObject instances.
  • Avoid String Concatenation: In loops, never concatenate strings using the + operator. Use TStringBuilder instead to avoid repeatedly reallocating memory on the heap.
// Inefficient (creates hundreds of temporary heap strings)
for I := 1 to 1000 do
  LResponseText := LResponseText + LData[I];

// Efficient
LBuilder := TStringBuilder.Create;
try
  for I := 1 to 1000 do
    LBuilder.Append(LData[I]);
  Res.Send(LBuilder.ToString);
finally
  LBuilder.Free;
end;

2. Fast Streaming for Large Payloads

When transferring large JSON strings, files, or reports, do not load the entire file contents into a string variable. Stream it directly to the socket chunk-by-chunk using Res.SendFile or Res.Download to maintain a low RAM profile.

  • Bad: Loading a 100MB PDF into a TStringList or byte array.
  • Good: Passing a TFileStream directly to the response (letting Horse stream it efficiently).
procedure ServeFileHandler(Req: THorseRequest; Res: THorseResponse);
var
  LStream: TFileStream;
begin
  LStream := TFileStream.Create('C:\data\largefile.zip', fmOpenRead or fmShareDenyWrite);
  Res.Status(THTTPStatus.OK).SendFile(LStream, 'largefile.zip');
  // Do NOT free LStream. Horse takes ownership of the stream.
end;

3. Selecting and Tuning the Transport Provider

The default Indy provider (Horse.Provider.Console) uses a thread-per-connection model. Under massive concurrency (thousands of connections), this model incurs thread-switching overhead.

Read the full file on GitHub · 69 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 69 lines · 26 tokens per session scan A ecd8539538b9

Subscribe to this mod's changes

horse-performance-tuning is a skill published in the GitHub repository HashLoad/horse (1,373 stars, last pushed 4d ago), licensed MIT. It adds 26 tokens to every session and 770 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.