Hospital Point-of-Care iPadOS Concurrency and Memory Audit
Examine Swift concurrency, offline caching, and memory safety for iPadOS electronic health record systems.
Deploy this template when optimizing intensive iPadOS bedside medical record applications. It isolates thread contention, main-actor stalls, and out-of-memory crashes in clinical care settings.
Role: Principal iOS Performance Engineer specializing in hospital-grade iPadOS point-of-care mobile software.
Context
- Health System: {{hospital_network_name}}
- Clinical Module: {{ehr_module_type}}
- Parallel Ingestion Feeds: {{concurrent_data_streams}}
- Local Persistence Cache: {{offline_cache_size}}
- Working Memory Limit: {{memory_threshold_mb}}
- Target Tablet Fleet: {{ipad_hardware_generations}}
Task
Generate a concurrency, caching, and memory footprint analysis for the {{ehr_module_type}} deployed across {{ipad_hardware_generations}} within {{hospital_network_name}}.
Method
- Analyze Swift modern concurrency actors handling {{concurrent_data_streams}} to identify actor hopping and data race risks.
- Evaluate MainActor isolation across chart rendering views to verify zero UI hitching during rapid patient record switching.
- Audit offline cache eviction policies against the configured {{offline_cache_size}} ceiling to prevent persistent memory exhaustion.
- Review Core Data or SQLite concurrency structures (e.g., NSManagedObjectContext hierarchies) for cross-thread deadlocks.
- Map memory allocation trajectories during intensive document rendering against the {{memory_threshold_mb}} boundary.
- Inspect high-resolution medical imaging thumbnail generation pipelines for autorelease pool leaks.
- Propose Instrument-based profiling workflows (Time Profiler, Allocations, Swift Concurrency) tailored for {{ipad_hardware_generations}}.
Constraints
- Analysis MUST explicitly account for lowest-spec devices listed in {{ipad_hardware_generations}}.
- Recommendations MUST NOT advise bypassing strict concurrency checking (complete concurrency checking enabled).
- Memory remediation guidance MUST avoid force-clearing critical in-memory patient safety alarms.
- Keep findings strictly actionable for native Swift and SwiftUI/UIKit production environments.
Output format
Structure the evaluation with these specific sections:
- Bedside Performance Profile (Summary table comparing hardware limits vs app profile)
- Swift Concurrency & Main-Thread Audit (Analysis of actor boundaries and UI thread safety)
- Cache and Memory Consumption Analysis (Detailed review of {{offline_cache_size}} and {{memory_threshold_mb}})
- Remediation and Profiling Action Plan (Prioritized technical recommendations)
Self-review
- Ensure memory ceilings reflect realistic OS limits for {{ipad_hardware_generations}}.
- Check that actor reentrancy scenarios are explicitly evaluated for incoming {{concurrent_data_streams}}.
- Verify all profiling recommendations reference standard Apple developer Instruments tools.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.