The performance monitoring system has been completely rewritten to provide more accurate and detailed metrics.
Instead of one-time measurements, the system now collects data from multiple runs and provides:
- Minimum value
- Maximum value
- Mean value
- Median value
- Standard Deviation (shows variability)
- Number of measurements
Each module is now measured separately:
- AppPreload
- App
- Auth
- User
- Dictionaries
- Words
- Notification
- Updater
- AppVersion
All metrics are automatically saved to files:
- Location:
~/Library/Application Support/electron-dictionaries/performance-logs/ - Format:
performance-YYYY-MM-DDTHH-MM-SS.log - Includes: timestamps, all measurements, statistics
Detailed information about memory usage:
- Heap Used/Total
- RSS (Resident Set Size)
- External memory
- Memory delta (changes between before/after)
npm run dev:electronAfter starting, you will see:
================================================================================
🚀 Starting Application Bootstrap with Performance Monitoring
================================================================================
[MEMORY] app-start: heap: X/X MB, rss: X MB, ext: X MB
[PERFORMANCE] module-AppPreload: X.XXms
[PERFORMANCE] module-App: X.XXms
...
================================================================================
PERFORMANCE STATISTICS
================================================================================
📊 module-App:
Runs: X
Mean: X.XXms
Median: X.XXms
Min: X.XXms
Max: X.XXms
StdDev: X.XXms
Memory Δ: heap X.XXMB, rss X.XXMB
...
================================================================================
📁 Full log saved to: /Users/.../performance-logs/performance-XXX.log
================================================================================
✅ Application ready!
For the most accurate results, use the test script:
./scripts/performance-test.shThis script:
- Runs the application 5 times
- Collects all metrics
- Saves results in
./performance-results/ - Allows you to analyze aggregated data
You can change the number of runs by editing the RUNS variable in the script.
Variations in metrics are completely normal and occur due to:
- Garbage Collection (GC): V8 can trigger GC at any moment
- JIT Compilation: Code is compiled "on the fly" and cached
- OS Caching: Files may or may not be in the cache
- Background Processes: The OS performs other tasks
- Cold vs Warm Start: The first run is always slower
- CPU Throttling: The processor may reduce frequency to save energy
- < 10ms: Very stable performance ✅
- 10-30ms: Normal variability ✅
- > 30ms: High variability
⚠️ (may indicate an issue)
- If Mean and Median are close - data is stable
- If Mean > Median significantly - there are outliers, possibly due to GC or background processes
📊 total-bootstrap:
Runs: 10
Mean: 245.32ms
Median: 240.15ms
Min: 178.77ms
Max: 316.73ms
StdDev: 38.21ms
Analysis:
- Average time: ~245ms
- Best time: ~179ms (likely a warm start)
- Worst time: ~317ms (possibly a cold start or GC)
- StdDev 38ms - moderate variability, normal for an Electron app
- Close other applications before testing
- Plug in your Mac (disables CPU throttling)
- Run 10-20 times for statistically significant data
- Ignore the first 2-3 runs (warmup period)
- Test under consistent conditions (temperature, system load)
const monitor = new PerformanceMonitor();
// Simple measurement
monitor.startMeasure("my-operation");
await doSomething();
monitor.endMeasure("my-operation");
// Measurement with memory
monitor.startMeasure("my-operation", true); // captureMemory = true
await doSomething();
monitor.endMeasure("my-operation", true);
// Show statistics
monitor.printStatistics();
// Show statistics for a specific operation
monitor.printStatistics("my-operation");
// Clear measurements
monitor.clearMeasurements(); // Clear all
monitor.clearMeasurements("my-operation"); // Clear specific
// Get log file path
const logPath = monitor.getLogFilePath();src/main/performance-monitor.ts- PerformanceMonitor classsrc/main/app.ts- Integration of monitoring into bootstrapscripts/performance-test.sh- Script for automatic testing- Logs:
~/Library/Application Support/electron-dictionaries/performance-logs/