# Performance Research Notes

**Started**: 2026-02-14
**Focus**: Throughput, Async I/O, 1000+ connections

---

## Key Performance Requirements for Normogen

### 1. Large Data Transfer
- Encrypted health data can be 10MB+ per request
- Batch operations for mobile sync
- Family health data aggregation
- Historical trends and analytics

### 2. Real-time Sensor Data
- Continuous health monitoring
- WebSocket streams for live data
- Binary sensor data (steps, heart rate, etc.)
- Multiple concurrent sensors per user

### 3. Lazy Loading Patterns
- Deferred decryption of sensitive data
- Lazy relationship loading
- On-demand data transformation
- Background job processing

### 4. Concurrent Connection Scaling
- 1000+ connections mid-term
- 10000+ connections long-term
- Connection pooling efficiency
- Memory optimization per connection

---

## Performance Benchmarks Needed

### TechEmpower Framework Benchmarks
- JSON serialization
- Multiple queries
- Plaintext
- Data update
- Fortunes (templating)

### Custom Benchmarks
- Large response (10MB+ JSON)
- Streaming response
- WebSocket throughput
- Concurrent connection scaling

---

## Async Runtime Comparison

### Tokio (Axum)
- Industry standard async runtime
- Excellent I/O performance
- Work-stealing scheduler
- epoll/io_uring support

### Actix-rt (Actix)
- Based on Tokio but with actor model
- Message passing overhead?
- Different scheduling strategy
- May have higher latency

---

## Critical Findings Needed

1. Which framework handles large responses better?
2. Streaming support quality?
3. Memory usage per 1000 connections?
4. WebSocket implementation stability?
5. MongoDB integration patterns?
6. Async lazy loading support?

---

## Research Log

### 2026-02-14
- Created performance-focused research plan
- Identified key requirements for encrypted data
- Set up benchmark comparison framework

