Optimize Gamma API performance and reduce latency.
Use when experiencing slow response times, optimizing throughput,
or improving user experience with Gamma integrations.
Trigger with phrases like "gamma performance", "gamma slow",
"gamma latency", "gamma optimization", "gamma speed".
Optimize Gamma API performance and reduce latency.
Use when experiencing slow response times, optimizing throughput,
or improving user experience with Gamma integrations.
Trigger with phrases like "gamma performance", "gamma slow",
"gamma latency", "gamma optimization", "gamma speed".
allowed-tools
Read, Write, Edit
version
1.13.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
["saas","gamma","api","performance"]
compatibility
Designed for Claude Code, also compatible with Codex and OpenClaw
Gamma Performance Tuning
Overview
Optimize Gamma API integration performance. Gamma's generate-poll-retrieve pattern means most latency is in generation time (10-60s), not API call overhead. Optimize by: reducing poll overhead, parallelizing batch operations, caching results, and choosing the right generation parameters.
Prerequisites
Working Gamma integration (see gamma-sdk-patterns)
// Shorter content = faster generation// "brief" text = fewer AI-generated words per card = faster// SLOWER: extensive text on many cardsawait gamma.generate({
content: "Comprehensive 20-card guide to machine learning...",
outputFormat: "presentation",
textAmount: "extensive", // More text per card = slower
});
// FASTER: brief text, fewer implied cardsawait gamma.generate({
content: "5-card overview of ML basics: supervised, unsupervised, reinforcement, deep learning, applications",
outputFormat: "presentation",
textAmount: "brief", // Less text per card = faster
});
// FASTEST: preserve mode (no AI text generation)await gamma.generate({
content: "Your pre-written slide content here...",
outputFormat: "presentation",
textMode: "preserve", // Uses your text as-is, no AI rewriting
});
Step 5: Preload Data at Startup
// src/gamma/preload.ts// Fetch themes and folders at app startup, not per-requestlet preloaded = false;
exportasyncfunctionpreloadGammaData(gamma: GammaClient) {
if (preloaded) return;
const [themes, folders] = awaitPromise.all([
gamma.listThemes(),
gamma.listFolders(),
]);
// Cache for the session
cache.set("gamma:themes", themes, 0); // No TTL (until restart)
cache.set("gamma:folders", folders, 0);
preloaded = true;
console.log(`Preloaded ${themes.length} themes, ${folders.length} folders`);
}