Skip to content

perf: Move sync push from save() to command layer#71

Merged
arimxyer merged 2 commits intomainfrom
fix/sync-push-command-layer
Jan 29, 2026
Merged

perf: Move sync push from save() to command layer#71
arimxyer merged 2 commits intomainfrom
fix/sync-push-command-layer

Conversation

@arimxyer
Copy link
Owner

Summary

  • Removes auto-push from save() so vault writes are purely local I/O (no network)
  • Adds SyncPush() method to VaultService, called once at command end (CLI) or TUI exit
  • Reduces network round-trips from N-per-session to 1

Benchmarks

Operation Time Network calls
save() (after) 28ms 0
SyncPush() 80ms 2 (sync + lsjson)

5 operations in TUI: ~2.1s blocking → ~540ms total.

Test plan

  • TestVaultSave_DoesNotTriggerPush — save() no longer calls SmartPush
  • TestVaultSyncPush_CallsSmartPush — SyncPush() calls SmartPush
  • TestVaultSyncPush_SkipsOnConflict — SyncPush() skips when conflict detected
  • BenchmarkSave_NoNetworkCost — save() completes in ~28ms
  • BenchmarkSyncPush_IncursNetworkCost — SyncPush() completes in ~80ms
  • All existing unit and integration tests pass

🤖 Generated with Claude Code

arimxyer and others added 2 commits January 29, 2026 17:42
save() no longer triggers network sync. SyncPush() is called once
at command end (CLI) or on TUI exit, reducing network round-trips
from N-per-session to 1.

Co-Authored-By: Claude <noreply@anthropic.com>
Demonstrates save() has zero network cost (28ms) while SyncPush()
incurs the sync delay once (80ms with 200ms mock). Validates the
command-layer push refactor.

Co-Authored-By: Claude <noreply@anthropic.com>
@arimxyer arimxyer merged commit aee3111 into main Jan 29, 2026
14 checks passed
@arimxyer arimxyer deleted the fix/sync-push-command-layer branch January 29, 2026 22:51
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.

1 participant

Comments