AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Performance Optimization

skill-jonathan0823-opencode-config-performance-optimization · by Jonathan0823

Performance optimization strategies including caching, profiling, database query optimization, frontend optimization, and load testing. Use when optimizing application performance, reducing latency, improving throughput, or diagnosing performance bottlenecks.

No reviews yet
0 installs
10 views
0.0% view→install

Install

$ agentstack add skill-jonathan0823-opencode-config-performance-optimization

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-jonathan0823-opencode-config-performance-optimization)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Performance Optimization? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Performance Optimization Skill

Overview

This skill provides comprehensive performance optimization strategies covering application profiling, caching strategies, database optimization, frontend performance, and load testing methodologies.

Quick Start

Performance Checklist

  • [ ] Profile to identify bottlenecks before optimizing
  • [ ] Optimize database queries and add indexes
  • [ ] Implement caching at appropriate layers
  • [ ] Use CDN for static assets
  • [ ] Enable compression and minification
  • [ ] Implement lazy loading
  • [ ] Use connection pooling
  • [ ] Load test before production

Common Bottlenecks

  1. N+1 Query Problem - Missing eager loading
  2. Missing Indexes - Full table scans
  3. Synchronous I/O - Blocking operations
  4. Large Payloads - Unoptimized responses
  5. Memory Leaks - Unreleased resources
  6. Cold Starts - Unoptimized initialization

Caching Strategies

Application-Level Caching

# Python with functools.lru_cache
from functools import lru_cache

@lru_cache(maxsize=128)
def get_user_by_id(user_id: int) -> dict:
    return db.query(User).get(user_id)

# Redis caching
import redis
from functools import wraps

r = redis.Redis(host='localhost', port=6379, db=0)

def cache_with_ttl(seconds=300):
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            key = f"{func.__name__}:{args}:{kwargs}"
            cached = r.get(key)
            if cached:
                return json.loads(cached)
            
            result = func(*args, **kwargs)
            r.setex(key, seconds, json.dumps(result))
            return result
        return wrapper
    return decorator

@cache_with_ttl(seconds=600)
def get_expensive_data(param: str):
    # Expensive operation
    return result

CDN Caching

# CloudFront/CloudFlare headers
Cache-Control: public, max-age=31536000, immutable  # Static assets
Cache-Control: public, max-age=3600                 # API responses
Cache-Control: private, no-cache                    # User-specific data

Database Query Caching

# SQLAlchemy query caching
from sqlalchemy.orm import joinedload

# ❌ N+1 Problem
users = db.query(User).all()
for user in users:
    print(user.profile.bio)  # N additional queries

# ✅ Eager Loading
users = db.query(User).options(joinedload(User.profile)).all()

# ✅ Selective Loading
users = db.query(User).options(
    joinedload(User.profile),
    joinedload(User.posts)
).all()

Database Optimization

Query Optimization

-- ❌ Full table scan
SELECT * FROM orders WHERE YEAR(created_at) = 2024;

-- ✅ Index-friendly query
SELECT * FROM orders 
WHERE created_at >= '2024-01-01' 
AND created_at  import('./Dashboard'));
const Analytics = lazy(() => import('./Analytics'));

// Route-based splitting

Image Optimization


  
  
  

import Image from 'next/image';

Profiling

Python Profiling

# cProfile
import cProfile
import pstats

profiler = cProfile.Profile()
profiler.enable()

# Your code here
result = expensive_function()

profiler.disable()
stats = pstats.Stats(profiler)
stats.sort_stats('cumulative')
stats.print_stats(20)

# Line profiler
from line_profiler import LineProfiler

profiler = LineProfiler()

@profiler  # Add decorator
def my_function():
    for i in range(1000):
        x = [i ** 2 for i in range(1000)]
    return x

my_function()
profiler.print_stats()

Database Query Analysis

-- PostgreSQL EXPLAIN ANALYZE
EXPLAIN (ANALYZE, BUFFERS, FORMAT JSON)
SELECT * FROM orders o
JOIN users u ON o.user_id = u.id
WHERE o.status = 'pending';

-- MySQL EXPLAIN
EXPLAIN ANALYZE
SELECT * FROM orders 
WHERE user_id = 123 
ORDER BY created_at DESC 
LIMIT 10;

Detailed References

See comprehensive guides in references/:

  • [Caching Strategies](references/caching.md) - Redis, CDN, application caching, cache invalidation
  • [Database Optimization](references/database-optimization.md) - Query optimization, indexing, connection pooling
  • [Frontend Performance](references/frontend-performance.md) - Code splitting, lazy loading, image optimization, Core Web Vitals
  • [Load Testing](references/load-testing.md) - k6, Artillery, JMeter, performance testing strategies

When to Use This Skill

Use this skill when:

  • Application is slow or unresponsive
  • Database queries are taking too long
  • API response times need improvement
  • Implementing caching strategies
  • Optimizing frontend performance
  • Preparing for high traffic events
  • Conducting performance audits
  • Setting up monitoring and alerting

Related Skills

  • @kubernetes-patterns - Scaling and resource optimization
  • @docker-patterns - Container optimization
  • @postgresql-patterns - Database-specific optimization
  • @mongodb-patterns - NoSQL optimization
  • @observability-monitoring - Performance monitoring

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.