Skip to content

perf: add sync benchmark workflow and optimize network apply path#49

Merged
andinux merged 11 commits into
mainfrom
perf/sync-benchmarks-and-optimizations
May 26, 2026
Merged

perf: add sync benchmark workflow and optimize network apply path#49
andinux merged 11 commits into
mainfrom
perf/sync-benchmarks-and-optimizations

Conversation

@andinux
Copy link
Copy Markdown
Collaborator

@andinux andinux commented May 26, 2026

Adds a sync benchmark harness and GitHub Actions workflow for measuring end-to-end sender-to-receiver latency.

Changes

  • Adds short-lived sync ticket support, with ticket values redacted from trace logs.
  • Optimizes small change payloads by sending base64 content directly to the apply endpoint, while keeping larger payloads on the upload URL path.
  • Adds curl handle reuse controls through CLOUDSYNC_CURL_POOL.
  • Adds make sync-bench and make sync-bench-debug.
  • Adds test/sync_bench.c for JSON/text benchmark reports.
  • Adds a manual sync-bench GitHub Actions workflow with uploaded benchmark artifacts.
  • Adds network tracing behind CLOUDSYNC_NETWORK_TRACE.
  • Updates integration coverage to continue exercising the bulk upload failure path.

Notes

Expired sync tickets are intentionally left to the API fallback behavior instead of adding client-side time parsing, keeping the client change small and portable.

andinux added 11 commits May 13, 2026 12:23
Add a sync benchmark harness with debug step traces and network endpoint timing logs.
Add a small per-network_data curl easy-handle pool for API and artifact requests to preserve connection reuse across sync operations. The pool is enabled by default and can be disabled with CLOUDSYNC_CURL_POOL=0, false, off, or no. Connection reuse is bounded by CLOUDSYNC_CURL_MAXCONNECTS, CLOUDSYNC_CURL_MAXAGE_CONN_SECONDS, and CLOUDSYNC_CURL_MAXLIFETIME_CONN_SECONDS.
Add a workflow_dispatch job that runs sync-bench-debug with benchmark secrets and uploads JSON output plus trace logs as artifacts.
- cache rotated CloudSync ticket headers and send them on later sync API requests
- support ticket reuse in both libcurl and native Apple network transports
- clear cached tickets when auth or endpoints change
- add CLOUDSYNC_NETWORK_TICKET=0 opt-out and trace logging for benchmark comparisons
…eration

With the fast-lane for small payload, the cloudsync service returns immediately the error, while for bigger payloads the apply job is processed asynchronously.
Raise the inline apply fast-lane payload limit to 128 KiB.

Add a configurable random BLOB payload to sync-bench inserts with a 100 KiB default and replicated BLOB verification.

Clean up old sync-bench rows before measured inserts and report cleanup retention and delete counts.

Include request byte counts in network receive and upload trace logs.
Avoid writing runtime ticket values to CLOUDSYNC_NETWORK_TRACE logs, since benchmark CI uploads those logs as artifacts. Keep the trace signal by logging only whether a ticket was received and the existing expiry metadata.
@andinux andinux merged commit 7b2a2a3 into main May 26, 2026
29 checks passed
@andinux andinux deleted the perf/sync-benchmarks-and-optimizations branch May 26, 2026 15:19
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