[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6EBKDR5R42T2586Y78YPFTD":3,"skill-same:01M6EBKDR5R42T2586Y78YPFTD":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":30,"linkOnly":31,"markdownContent":32,"markdownBody":33,"frontMatter":34,"refName":26,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":6,"ownerDescription":41,"updatedAt":42,"install":43,"resources":56},"01M6EBKDR5R42T2586Y78YPFTD","nestjs-performance",null,"Fastify adapter, Scope management, and Compression. Use when optimizing NestJS performance with Fastify, request-scoped providers, or compression. (triggers: main.ts, FastifyAdapter, compression, SINGLETON, REQUEST scope)","ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",67,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-performance\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29],"performance","nestjs","nestjs performance","compression","Providers","management","use","main","triggers","scope","adapter","2026-11-10 10:12:30",false,"---\nname: nestjs-performance\ndescription: \"Fastify adapter, Scope management, and Compression. Use when optimizing NestJS performance with Fastify, request-scoped providers, or compression. (triggers: main.ts, FastifyAdapter, compression, SINGLETON, REQUEST scope)\"\n---\n\n# Performance Tuning\n\n## **Priority: P1 (OPERATIONAL)**\n\nHigh-performance patterns and optimization techniques for NestJS applications.\n\n- **Adapter**: Use `FastifyAdapter` instead of Express (2x throughput).\n- **Compression**: Enable Gzip\u002FBrotli compression.\n\n  ```typescript\n  \u002F\u002F main.ts\n  app.use(compression());\n  ```\n\n- **Keep-Alive**: Configure `http.Agent` keep-alive settings to reuse TCP connections for upstream services.\n\n## Scope & Dependency Injection\n\n- **Default Scope**: Adhere to `SINGLETON` scope (default).\n- **Request Scope**: AVOID `REQUEST` scope unless absolutely necessary.\n  - **Pro Tip**: A single request-scoped service makes its entire injection chain request-scoped.\n  - **Solution**: Use **Durable Providers** (`durable: true`) for multi-tenancy.\n- **Lazy Loading**: Use `LazyModuleLoader` for heavyweight modules (e.g., Admin panels).\n\n## Caching Strategy\n\n- **Application Cache**: Use `@nestjs\u002Fcache-manager` for computation results.\n  - **Deep Dive**: See **[Caching & Redis](..\u002Fnestjs-caching\u002FSKILL.md)** for L1\u002FL2 strategies and Invalidation patterns.\n- **HTTP Cache**: Set `Cache-Control` headers for client-side caching (CDN\u002FBrowser).\n- **Distributed**: In microservices, use Redis store, not memory store.\n\n## Queues & Async Processing\n\n- **Offloading**: Never block the HTTP request for long-running tasks (Emails, Reports, webhooks).\n- **Tool**: Use `@nestjs\u002Fbull` (BullMQ) or RabbitMQ (`@nestjs\u002Fmicroservices`).\n  - **Pattern**: Producer (Controller) -> Queue -> Consumer (Processor).\n\n## Serialization\n\n- **Warning**: `class-transformer` is CPU expensive.\n- **Optimization**: For high-throughput READ endpoints, consider manual mapping or using `fast-json-stringify` (built-in fastify serialization) instead of interceptors.\n\n## Database Tuning\n\n- **Projections**: Always use `select: []` to fetch only needed columns.\n- **N+1**: Prevent N+1 queries by using `relations` carefully or `DataLoader` for Graph\u002FField resolvers.\n- **Connection Pooling**: Configure pool size (e.g., `pool: { min: 2, max: 10 }`) in config to match DB limits.\n\n## Profiling & Scaling\n\n- **API Overhead vs DB Execution**: Use an \"Execution Bucket\" strategy to continuously benchmark `Total Duration`, `DB Execution Time`, and `API Overhead`.\n  - **Total Baseline**: Excellent (\u003C 50ms), Acceptable (\u003C 200ms), Poor (> 500ms). _Exception: Authentication routes (e.g. bcrypt\u002Fargon2) should take 300-500ms intentionally._\n  - **DB Execution Baseline**: Excellent (\u003C 5ms), Acceptable (\u003C 30ms), Poor (> 100ms - implies missing index or N+1 problem).\n  - **API Overhead Baseline**: Excellent (\u003C 20ms), Poor (> 100ms - implies heavy synchronous processing or serialization blocking Node's event loop).\n- **Offloading**: Move CPU-heavy tasks (Image processing, Crypto) to `worker_threads`.\n- **Clustering**: For non-containerized environments, use `ClusterModule` to utilize all CPU cores. In K8s, prefer ReplicaSets.\n\n\n## Anti-Patterns\n\n- **No REQUEST scope without evaluation**: One REQUEST-scoped provider makes the entire chain request-scoped.\n- **No CPU tasks in HTTP handler**: Offload image\u002Fcrypto work to `worker_threads` or BullMQ.\n- **No unprojected queries**: Always `select: []` the needed columns to avoid serializing unused data.\n\n","# Performance Tuning\n\n## **Priority: P1 (OPERATIONAL)**\n\nHigh-performance patterns and optimization techniques for NestJS applications.\n\n- **Adapter**: Use `FastifyAdapter` instead of Express (2x throughput).\n- **Compression**: Enable Gzip\u002FBrotli compression.\n\n  ```typescript\n  \u002F\u002F main.ts\n  app.use(compression());\n  ```\n\n- **Keep-Alive**: Configure `http.Agent` keep-alive settings to reuse TCP connections for upstream services.\n\n## Scope & Dependency Injection\n\n- **Default Scope**: Adhere to `SINGLETON` scope (default).\n- **Request Scope**: AVOID `REQUEST` scope unless absolutely necessary.\n  - **Pro Tip**: A single request-scoped service makes its entire injection chain request-scoped.\n  - **Solution**: Use **Durable Providers** (`durable: true`) for multi-tenancy.\n- **Lazy Loading**: Use `LazyModuleLoader` for heavyweight modules (e.g., Admin panels).\n\n## Caching Strategy\n\n- **Application Cache**: Use `@nestjs\u002Fcache-manager` for computation results.\n  - **Deep Dive**: See **[Caching & Redis](..\u002Fnestjs-caching\u002FSKILL.md)** for L1\u002FL2 strategies and Invalidation patterns.\n- **HTTP Cache**: Set `Cache-Control` headers for client-side caching (CDN\u002FBrowser).\n- **Distributed**: In microservices, use Redis store, not memory store.\n\n## Queues & Async Processing\n\n- **Offloading**: Never block the HTTP request for long-running tasks (Emails, Reports, webhooks).\n- **Tool**: Use `@nestjs\u002Fbull` (BullMQ) or RabbitMQ (`@nestjs\u002Fmicroservices`).\n  - **Pattern**: Producer (Controller) -> Queue -> Consumer (Processor).\n\n## Serialization\n\n- **Warning**: `class-transformer` is CPU expensive.\n- **Optimization**: For high-throughput READ endpoints, consider manual mapping or using `fast-json-stringify` (built-in fastify serialization) instead of interceptors.\n\n## Database Tuning\n\n- **Projections**: Always use `select: []` to fetch only needed columns.\n- **N+1**: Prevent N+1 queries by using `relations` carefully or `DataLoader` for Graph\u002FField resolvers.\n- **Connection Pooling**: Configure pool size (e.g., `pool: { min: 2, max: 10 }`) in config to match DB limits.\n\n## Profiling & Scaling\n\n- **API Overhead vs DB Execution**: Use an \"Execution Bucket\" strategy to continuously benchmark `Total Duration`, `DB Execution Time`, and `API Overhead`.\n  - **Total Baseline**: Excellent (\u003C 50ms), Acceptable (\u003C 200ms), Poor (> 500ms). _Exception: Authentication routes (e.g. bcrypt\u002Fargon2) should take 300-500ms intentionally._\n  - **DB Execution Baseline**: Excellent (\u003C 5ms), Acceptable (\u003C 30ms), Poor (> 100ms - implies missing index or N+1 problem).\n  - **API Overhead Baseline**: Excellent (\u003C 20ms), Poor (> 100ms - implies heavy synchronous processing or serialization blocking Node's event loop).\n- **Offloading**: Move CPU-heavy tasks (Image processing, Crypto) to `worker_threads`.\n- **Clustering**: For non-containerized environments, use `ClusterModule` to utilize all CPU cores. In K8s, prefer ReplicaSets.\n\n\n## Anti-Patterns\n\n- **No REQUEST scope without evaluation**: One REQUEST-scoped provider makes the entire chain request-scoped.\n- **No CPU tasks in HTTP handler**: Offload image\u002Fcrypto work to `worker_threads` or BullMQ.\n- **No unprojected queries**: Always `select: []` the needed columns to avoid serializing unused data.\n\n",{"name":5,"description":7},"def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-performance",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill nestjs-performance",{"tool":49,"command":50},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill nestjs-performance",{"tool":52,"command":53},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill nestjs-performance","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002FHoangNguyen0403\u002Fagent-skills-standard\u002Fnestjs-performance\u002FSKILL.md",true,[57,63,67],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Foptimization.md","REFERENCE","参考文档",1659,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fmlops\u002Finference\u002Fllama-cpp\u002Freferences\u002Foptimization.md",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fquantization.md",4956,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fmlops\u002Finference\u002Fllama-cpp\u002Freferences\u002Fquantization.md",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fserver.md",2259,"https:\u002F\u002Fgithub.com\u002Fq2805187159\u002FAnvil\u002Fblob\u002Fmain\u002Fskills\u002Fmlops\u002Finference\u002Fllama-cpp\u002Freferences\u002Fserver.md",[72,86,96,105,111,118],{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":82,"publishedAt":30},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[77],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[83,84,85],"model","model hierarchy","model hierarchy skill",{"skillNo":87,"name":88,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":92,"publishedAt":30},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[91],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},[93,94,95],"MCP","zoom","zoom mcp",{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":30},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[102,103,104,94],"sdk","zoom apps sdk","apps",{"skillNo":106,"name":107,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":30},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[107],{"skillNo":112,"name":113,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":114,"categories":115,"keywords":117,"publishedAt":30},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[116],{"categoryNo":78,"categoryName":79,"taxonomyType":80,"taxonomyTypeDesc":81},[113],{"skillNo":119,"name":120,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":30},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[120]]