- Home
- Skills
- Dasien
- Claudemultiagenttemplate
- Optimization Patterns
optimization-patterns_skill
- Python
3
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill dasien/claudemultiagenttemplate --skill optimization-patterns- SKILL.md5.6 KB
Overview
This skill applies proven optimization patterns—caching strategies, database tuning, and algorithmic improvements—to speed up applications and reduce resource use. It focuses on systematic, measurable changes that improve response times, throughput, and scalability. Practical techniques target expensive computations, slow queries, and inefficient data handling.
How this skill works
The skill inspects code paths, database access patterns, and resource hotspots identified by profiling. It recommends and implements multi-level caching (in-memory, Redis, CDN), query and index changes, pagination and batching, and algorithmic swaps to lower time complexity. Changes are validated with before/after metrics and safe cache invalidation strategies.
When to use it
- After profiling reveals CPU, I/O, or DB bottlenecks
- When API responses or page load times are slow
- For read-heavy database workloads or expensive repeated computations
- When scaling to more users or larger datasets
- Before provisioning more hardware to reduce costs
Best practices
- Cache at appropriate levels with clear TTLs or event-driven invalidation
- Add indexes for WHERE, JOIN, and ORDER BY columns; measure impact
- Batch and paginate large operations to avoid memory spikes
- Use connection pools and limit network round trips
- Prefer appropriate data structures and reduce algorithmic complexity
- Measure metrics before and after each change; avoid premature optimization
Example use cases
- Speeding up a user dashboard by combining queries, adding indexes, and caching aggregated results
- Reducing API latency by introducing Redis caching and async I/O
- Optimizing a reporting job by streaming data and parallelizing independent tasks
- Improving throughput for bulk writes via batching and connection pooling
- Lowering memory use by replacing full-table loads with LIMIT/pagination and materialized views
FAQ
Cache results of expensive or frequently repeated computations and queries with predictable inputs. Use short TTLs or event-based invalidation for volatile data.
Will adding indexes always help?
Indexes speed reads for specific filters and joins but can slow writes and increase storage. Add targeted indexes, test query plans, and monitor write performance.