perf: add sync benchmark workflow and optimize network apply path#49
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a sync benchmark harness and GitHub Actions workflow for measuring end-to-end sender-to-receiver latency.
Changes
CLOUDSYNC_CURL_POOL.make sync-benchandmake sync-bench-debug.test/sync_bench.cfor JSON/text benchmark reports.sync-benchGitHub Actions workflow with uploaded benchmark artifacts.CLOUDSYNC_NETWORK_TRACE.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.