perf: speed up new-session creation #256
No reviewers
Labels
No labels
backend
bug
chore
duplication
effort:complex
effort:medium
effort:trivial
enhancement
frontend
fullstack
priority:high
ready-for-agent
refactor
security
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dries/ocman!256
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/fast-session-create"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Creating a new session took multiple seconds. Two causes fixed:
Adapter.CreateSessionalways ran an uncachedlsofscan on every create (full socket scan + onelsof -pfork per opencode PID on macOS). Now it reads the cached port map first and only falls back to the fresh scan on a miss (just-launched process the cache hasn't seen).[400,600,800,1200,1500,2000,3000]), catching a quick boot in ~400ms while keeping the same ~9.5s total budget.Testing
TestCreateSession_CachedPortSkipsFreshScan(cache hit must not re-scan).make lint,go test ./...,pnpm testall pass.Coverage ratchet: ✅ pass
Tolerance: -0.1%. Baseline stored on
gh-pages.