hex-performance-tuning
FreeNo executable scriptsNot checkedOptimize Hex API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or…
by jeremylongshore★ 2,961 GitHub starsAbout this skill
Hex Performance Tuning
Latency Benchmarks
| Operation | Typical Duration |
|---|---|
| ListProjects | 200-500ms |
| RunProject (trigger) | 500ms-2s |
| Project execution | 10s-30min (depends on queries) |
| GetRunStatus (poll) | 100-300ms |
Instructions
Cache Project Lists
import { LRUCache } from 'lru-cache';
const projectCache = new LRUCache<string, any>({ max: 50, ttl: 300000 }); // 5 min
async function getCachedProjects(client: HexClient) {
const cached = projectCache.get('projects');
if (cached) return cached;
const projects = await client.listProjects();
projectCache.set('projects', projects);
return projects;
}
Parallel Independent Runs
// Run independent projects in parallel (respecting rate limits)
async function parallelRuns(client: HexClient, configs: Array<{ id: string; params: any }>) {
return Promise.allSettled(
configs.map(c => runWithRetry(client, c.id, c.params))
);
}
Optimize Poll Interval
// Adaptive polling: start fast, slow down
async function adaptivePoll(client: HexClient, projectId: string, runId: string) {
let interval = 2000; // Start at 2s
while (true) {
const status = await client.getRunStatus(projectId, runId);
if (['COMPLETED', 'ERRORED', 'KILLED'].includes(status.status)) return status;
await new Promise(r => setTimeout(r, interval));
interval = Math.min(interval * 1.5, 30000); // Max 30s
}
}
Overview
Tune run latency and throughput using safe sandbox projects and aggregate metrics. A gain is invalid if it expands data scope, compromises output correctness, exceeds quota, or makes rollback impossible.
Prerequisites
- Baseline latency/run metrics, safe fixture revision, approved error budget, and a rollback revision for cache, concurrency, parameters, and retry policy.
Output
Return a tuning receipt with baseline/canary percentile bands, cache/concurrency/parameter revisions, quota/error outcomes, aggregate assertion, owner approval, and rollback reference. Use aggregates only.
Error Handling
Roll back for quota saturation, increased errors, changed output assertion, access drift, or duplicate runs. Do not raise concurrency or cache duration to hide a failing dependency.
Examples
env=sandbox; p95=420ms->310ms; concurrency=2; cache=r4; quota=within-budget; assertions=pass; rollback=perf-r3 documents a safe canary.
Resources
Install hex-performance-tuning in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
ReadWriteEditFAQ
What does the hex-performance-tuning skill do?
Optimize Hex API performance with caching, batching, and connection pooling. Use when experiencing slow API responses, implementing caching strategies, or optimizing request throughput for Hex integrations. Trigger with phrases like "hex performance", "optimize hex", "hex latency", "hex caching", "hex slow", "hex batch".
How do I install the hex-performance-tuning skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the hex-performance-tuning skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
by Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
by Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
by Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
by Anthropic