Performance optimizations: LazyVStack, UI batching, timer consolidation (#375)

- Replace VStack with LazyVStack for message list to enable on-demand rendering
- Batch UI updates in ChatViewModel to reduce main thread operations
- Consolidate 12 timers into 3 (high/medium/low frequency) in BluetoothMeshService
- Fix thread safety in scheduleUIUpdate with main thread check

These changes significantly improve app responsiveness and reduce CPU usage.

Co-authored-by: jack <jackjackbits@users.noreply.github.com>
This commit is contained in:
jack
2025-08-01 01:05:59 +02:00
committed by GitHub
co-authored by jack
parent 8f32edaa64
commit a6c2e751d2
3 changed files with 140 additions and 24 deletions
+1 -1
View File
@@ -239,7 +239,7 @@ struct ContentView: View {
private func messagesView(privatePeer: String?) -> some View {
ScrollViewReader { proxy in
ScrollView {
VStack(alignment: .leading, spacing: 0) {
LazyVStack(alignment: .leading, spacing: 0) {
// Extract messages based on context (private or public chat)
let messages: [BitchatMessage] = {
if let privatePeer = privatePeer {