replit-performance-tuning

Featured

Optimize Replit app performance: cold start, memory, Nix caching, and deployment speed. Use when experiencing slow startup, high memory usage, deployment timeouts, or optimizing Replit container resource usage. Trigger with phrases like "replit performance", "optimize replit", "replit slow", "replit cold start", "replit memory", "replit startup time".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Replit Performance Tuning ## Overview Optimize Replit app performance across the entire lifecycle: cold start reduction, Nix environment caching, build speed, runtime memory management, and deployment configuration. Replit containers have resource limits — efficient usage is critical. ## Prerequisites - Replit app deployed or running in Workspace - Understanding of `.replit` and `replit.nix` - Access to deployment monitoring ## Instructions ### Step 1: Reduce Cold Start Time Autoscale deployments scale to zero when idle. First request triggers a cold start (10-30s). Minimize it: ```typescript // 1. Lazy-load heavy modules — only import when needed // BAD: imports everything at startup import { heavyAnalytics } from './analytics'; // 500ms import { imageProcessor } from './images'; // 300ms // GOOD: import on demand app.get('/api/analyze', async (req, res) => { const { heavyAnalytics } = await import('./analytics'); res.json(await heavyAnalytics.process(req.query)); }); // 2. Defer non-critical initialization let dbPool: Pool | null = null; function getDB(): Pool { if (!dbPool) { dbPool = new Pool({ connectionString: process.env.DATABASE_URL, ssl: { rejectUnauthorized: false }, max: 5, // Keep pool small for faster init }); } return dbPool; } // 3. Start server immediately, initialize after const app = express(); const PORT = parseInt(process.env.PORT || '3000'); app.listen(PORT, '0.0.0.0', () => { console.log(`Server ready...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category