jeremylongshore

gamma-performance-tuning

@jeremylongshore/gamma-performance-tuning
jeremylongshore
1,004
123 forks
Updated 1/18/2026
View on GitHub

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".

Installation

$skills install @jeremylongshore/gamma-performance-tuning
Claude Code
Cursor
Copilot
Codex
Antigravity

Details

Pathplugins/saas-packs/gamma-pack/skills/gamma-performance-tuning/SKILL.md
Branchmain
Scoped Name@jeremylongshore/gamma-performance-tuning

Usage

After installing, this skill will be available to your AI coding assistant.

Verify installation:

skills list

Skill Instructions


name: gamma-performance-tuning description: | 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.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io

Gamma Performance Tuning

Overview

Optimize Gamma API integration performance for faster response times and better throughput.

Prerequisites

  • Working Gamma integration
  • Performance monitoring tools
  • Understanding of caching concepts

Instructions

Step 1: Client Configuration Optimization

import { GammaClient } from '@gamma/sdk';

const gamma = new GammaClient({
  apiKey: process.env.GAMMA_API_KEY,

  // Connection optimization
  timeout: 30000,
  keepAlive: true,
  maxSockets: 10,

  // Retry configuration
  retries: 3,
  retryDelay: 1000,
  retryCondition: (err) => err.status >= 500 || err.status === 429,

  // Compression
  compression: true,
});

Step 2: Response Caching

import NodeCache from 'node-cache';

const cache = new NodeCache({
  stdTTL: 300, // 5 minutes default
  checkperiod: 60,
});

async function getCachedPresentation(id: string) {
  const cacheKey = `presentation:${id}`;

  // Check cache first
  const cached = cache.get(cacheKey);
  if (cached) {
    return cached;
  }

  // Fetch from API
  const presentation = await gamma.presentations.get(id);

  // Cache the result
  cache.set(cacheKey, presentation);

  return presentation;
}

// Cache invalidation on updates
gamma.on('presentation.updated', (event) => {
  cache.del(`presentation:${event.data.id}`);
});

Step 3: Parallel Request Optimization

// Instead of sequential requests
async function getSequential(ids: string[]) {
  const results = [];
  for (const id of ids) {
    results.push(await gamma.presentations.get(id)); // Slow!
  }
  return results;
}

// Use parallel requests with concurrency control
import pLimit from 'p-limit';

const limit = pLimit(5); // Max 5 concurrent requests

async function getParallel(ids: string[]) {
  return Promise.all(
    ids.map(id => limit(() => gamma.presentations.get(id)))
  );
}

// Batch API if available
async function getBatch(ids: string[]) {
  return gamma.presentations.getBatch(ids); // Single request for multiple items
}

Step 4: Lazy Loading and Pagination

// Pagination for large lists
async function* getAllPresentations() {
  let cursor: string | undefined;

  do {
    const page = await gamma.presentations.list({
      limit: 100,
      cursor,
    });

    for (const presentation of page.items) {
      yield presentation;
    }

    cursor = page.nextCursor;
  } while (cursor);
}

// Usage
for await (const presentation of getAllPresentations()) {
  // Process one at a time, memory efficient
}

Step 5: Request Optimization

// Only request needed fields
const presentation = await gamma.presentations.get(id, {
  fields: ['id', 'title', 'url', 'updatedAt'], // Skip large fields
});

// Avoid redundant API calls
const createOptions = {
  title: 'My Presentation',
  prompt: 'AI content',
  returnImmediately: true, // Don't wait for generation
};

const { id, statusUrl } = await gamma.presentations.create(createOptions);

// Poll status separately if needed
const status = await gamma.presentations.status(id);

Step 6: Connection Pooling

import http from 'http';
import https from 'https';

// Reuse connections
const httpAgent = new http.Agent({
  keepAlive: true,
  maxSockets: 25,
  maxFreeSockets: 10,
  timeout: 60000,
});

const httpsAgent = new https.Agent({
  keepAlive: true,
  maxSockets: 25,
  maxFreeSockets: 10,
  timeout: 60000,
});

const gamma = new GammaClient({
  apiKey: process.env.GAMMA_API_KEY,
  httpAgent,
  httpsAgent,
});

Performance Metrics

Monitoring Setup

import { performance } from 'perf_hooks';

async function timedRequest<T>(name: string, fn: () => Promise<T>): Promise<T> {
  const start = performance.now();

  try {
    const result = await fn();
    const duration = performance.now() - start;

    console.log(`[PERF] ${name}: ${duration.toFixed(2)}ms`);
    metrics.recordLatency(name, duration);

    return result;
  } catch (err) {
    const duration = performance.now() - start;
    console.log(`[PERF] ${name} FAILED: ${duration.toFixed(2)}ms`);
    throw err;
  }
}

// Usage
const presentation = await timedRequest('gamma.get', () =>
  gamma.presentations.get(id)
);

Performance Targets

OperationTargetAction if Exceeded
Simple GET< 200msCheck network, use caching
List (100 items)< 500msReduce page size
Create presentation< 5sUse async pattern
Export PDF< 30sUse webhook notification

Resources

Next Steps

Proceed to gamma-cost-tuning for cost optimization.

More by jeremylongshore

View all
oauth-callback-handler
1,004

Oauth Callback Handler - Auto-activating skill for API Integration. Triggers on: oauth callback handler, oauth callback handler Part of the API Integration skill category.

rabbitmq-queue-setup
1,004

Rabbitmq Queue Setup - Auto-activating skill for Backend Development. Triggers on: rabbitmq queue setup, rabbitmq queue setup Part of the Backend Development skill category.

model-evaluation-suite
1,004

evaluating-machine-learning-models: This skill allows Claude to evaluate machine learning models using a comprehensive suite of metrics. It should be used when the user requests model performance analysis, validation, or testing. Claude can use this skill to assess model accuracy, precision, recall, F1-score, and other relevant metrics. Trigger this skill when the user mentions "evaluate model", "model performance", "testing metrics", "validation results", or requests a comprehensive "model evaluation".

neural-network-builder
1,004

building-neural-networks: This skill allows Claude to construct and configure neural network architectures using the neural-network-builder plugin. It should be used when the user requests the creation of a new neural network, modification of an existing one, or assistance with defining the layers, parameters, and training process. The skill is triggered by requests involving terms like "build a neural network," "define network architecture," "configure layers," or specific mentions of neural network types (e.g., "CNN," "RNN," "transformer").