Performance optimization

From hmislk/hmis · View interactive version

Performance optimization is an AI agent skill from the GitHub repository hmislk/hmis. Performance optimization patterns for the HMIS project. Use when optimizing slow queries, improving autocomplete performance, tuning database queries, reducing page load times, optimizing report generation, or investigating performance issues.

How to use this skill

Skill file

Performance Optimization Guide

Core Principles

  1. Use DTOs throughout - Avoid converting to entities until necessary
  2. Cache autocomplete results - Preserve full DTO data for converters
  3. Skip unnecessary operations - Use configuration and conditional logic
  4. Defer expensive operations - Move to background or later in workflow

Autocomplete Optimization (85-90% improvement)

Key pattern from Pharmacy Retail Sale (639ms -> 50ms):

  1. Enhance DTO with fields needed for lightweight entity creation
  2. Cache autocomplete results in controller for converter reuse
  3. Skip discount calculations when no discount scheme active
  4. Defer item instructions loading to later in workflow

Query Optimization

MySQL Performance

Report Optimization

For detailed guides, read:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.