Skip to content

feat(network-monitor): improve Network Session logging performance#368

Merged
maatheusgois-dd merged 7 commits into
DebugSwift:mainfrom
ajinumoto:fix/session-history-modelActor
May 29, 2026
Merged

feat(network-monitor): improve Network Session logging performance#368
maatheusgois-dd merged 7 commits into
DebugSwift:mainfrom
ajinumoto:fix/session-history-modelActor

Conversation

@ajinumoto
Copy link
Copy Markdown
Contributor

@ajinumoto ajinumoto commented May 29, 2026

Summary

  • Split network session persistence into @MainActor manager and @ModelActor store.
  • Move SwiftData container/context work off main actor to reduce session history persistence overhead.
  • Replace SwiftData session-request relationship with sessionID lookup and Sendable record DTOs for UI reads.
  • Update session history and request list screens to fetch persisted records asynchronously.

Main-thread load dropped significantly, with cycles reduced by about 50%: 789.31M → 395.50M.

Type of change

  • Fix
  • Feature
  • Refactor
  • Docs
  • CI/CD

Test plan

  • Unit tests updated
  • Manual testing completed
  • CI passing

Manual test steps

  1. Enable Network Session Persistence beta feature.
  2. Capture several HTTP requests and confirm session history shows request count and duration.
  3. Open a saved session, search requests, and verify request detail still renders correctly.

Screenshots / recordings (if applicable)

This performance study uses a controlled concurrent-load method by executing 200 simultaneous requests in a TaskGroup against the same endpoint, with short-circuit mode enabled to remove external network/server variability and keep response behavior deterministic

Before:
image
image
After:
image
image

Checklist

  • I reviewed my own changes
  • I updated docs when needed
  • I considered backward compatibility

ajinumoto added 7 commits May 28, 2026 13:57
# Conflicts:
#	DebugSwift/Sources/Features/Network/Persistence/NetworkSessionPersistenceManager.swift
…o store (@Modelactor) and manager (@mainactor)

# Conflicts:
#	DebugSwift/Sources/Features/Network/Models/Entites/NetworkRequestEntity.swift
#	DebugSwift/Sources/Features/Network/Persistence/NetworkSessionPersistenceManager.swift
@ajinumoto ajinumoto changed the title Fix/session history model actor feat(network-monitor): improve Network Session logging performance May 29, 2026
@ajinumoto ajinumoto marked this pull request as ready for review May 29, 2026 08:29
@maatheusgois-dd maatheusgois-dd merged commit c663744 into DebugSwift:main May 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants