Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/sync-bench.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: sync benchmark

on:
workflow_dispatch:
inputs:
poll_delay_ms:
description: Polling delay between receiver checks, in milliseconds
required: false
default: '250'
max_polls:
description: Maximum number of receiver polling attempts
required: false
default: '40'
curl_pool:
description: Enable curl connection pool; use 0 to disable
required: false
default: '1'

permissions:
contents: read

jobs:
sync-bench-debug:
name: sync-bench-debug linux x86_64
runs-on: ubuntu-22.04
timeout-minutes: 20

env:
SYNC_BENCH_DATABASE_ID: ${{ secrets.SYNC_BENCH_DATABASE_ID }}
SYNC_BENCH_CLOUDSYNC_ADDRESS: ${{ secrets.SYNC_BENCH_CLOUDSYNC_ADDRESS }}
SYNC_BENCH_APIKEY: ${{ secrets.SYNC_BENCH_APIKEY }}
SYNC_BENCH_OUTPUT: json
SYNC_BENCH_POLL_DELAY_MS: ${{ inputs.poll_delay_ms }}
SYNC_BENCH_MAX_POLLS: ${{ inputs.max_polls }}
CLOUDSYNC_CURL_POOL: ${{ inputs.curl_pool }}

steps:
- uses: actions/checkout@v4.2.2
with:
submodules: true

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc make curl sqlite3 unzip

- name: Build debug benchmark
run: make SYNC_BENCH_DEBUG=1 extension dist/sync_bench

- name: Run sync benchmark
run: |
mkdir -p artifacts
./dist/sync_bench > artifacts/sync-bench.json 2> artifacts/sync-bench.trace.log

- name: Upload benchmark artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: sync-bench-debug-${{ github.run_id }}
path: |
artifacts/sync-bench.json
artifacts/sync-bench.trace.log
if-no-files-found: warn
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [1.0.20] - 2026-05-26

### Changed

- **Improved network sync performance** by reducing request overhead during `cloudsync_network_send_changes()`, especially for small payloads that can now be applied without the extra upload-URL round trip.
- **Improved repeated sync request latency** by allowing the network layer to reuse HTTP connections across CloudSync API calls.

## [1.0.19] - 2026-05-15

### Added

- **Mac Catalyst support**.

## [1.0.18] - 2026-04-29

### Fixed
Expand Down
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,10 @@ endif
T_LDFLAGS += -fprofile-arcs -ftest-coverage
endif

ifdef SYNC_BENCH_DEBUG
CFLAGS += -DCLOUDSYNC_NETWORK_TRACE
endif

# Native network support only for Apple platforms
ifdef NATIVE_NETWORK
RELEASE_OBJ += $(patsubst %.m, $(BUILD_RELEASE)/%_m.o, $(notdir $(wildcard $(NETWORK_DIR)/*.m)))
Expand Down Expand Up @@ -271,6 +275,25 @@ e2e: $(TARGET) $(DIST_DIR)/integration$(EXE)
fi; \
./$(DIST_DIR)/integration$(EXE)

# Run the sync performance benchmark. This is intentionally separate from e2e
# because timings depend on network/server load and polling configuration.
sync-bench: $(TARGET) $(DIST_DIR)/sync_bench$(EXE)
@if [ -f .env ]; then \
export $$(grep -v '^#' .env | xargs); \
fi; \
if [ -n "$(SYNC_BENCH_DATABASE_ID)" ]; then export SYNC_BENCH_DATABASE_ID="$(SYNC_BENCH_DATABASE_ID)"; fi; \
if [ -n "$(SYNC_BENCH_CLOUDSYNC_ADDRESS)" ]; then export SYNC_BENCH_CLOUDSYNC_ADDRESS="$(SYNC_BENCH_CLOUDSYNC_ADDRESS)"; fi; \
if [ -n "$(SYNC_BENCH_APIKEY)" ]; then export SYNC_BENCH_APIKEY="$(SYNC_BENCH_APIKEY)"; fi; \
if [ -n "$(SYNC_BENCH_POLL_DELAY_MS)" ]; then export SYNC_BENCH_POLL_DELAY_MS="$(SYNC_BENCH_POLL_DELAY_MS)"; fi; \
if [ -n "$(SYNC_BENCH_MAX_POLLS)" ]; then export SYNC_BENCH_MAX_POLLS="$(SYNC_BENCH_MAX_POLLS)"; fi; \
if [ -n "$(SYNC_BENCH_RANDOM_BLOB_SIZE_BYTES)" ]; then export SYNC_BENCH_RANDOM_BLOB_SIZE_BYTES="$(SYNC_BENCH_RANDOM_BLOB_SIZE_BYTES)"; fi; \
if [ -n "$(SYNC_BENCH_CLEANUP_OLDER_THAN_SECONDS)" ]; then export SYNC_BENCH_CLEANUP_OLDER_THAN_SECONDS="$(SYNC_BENCH_CLEANUP_OLDER_THAN_SECONDS)"; fi; \
if [ -n "$(SYNC_BENCH_OUTPUT)" ]; then export SYNC_BENCH_OUTPUT="$(SYNC_BENCH_OUTPUT)"; fi; \
./$(DIST_DIR)/sync_bench$(EXE)

sync-bench-debug:
$(MAKE) SYNC_BENCH_DEBUG=1 sync-bench

OPENSSL_TARBALL = $(OPENSSL_DIR)/$(OPENSSL_VERSION).tar.gz

$(OPENSSL_TARBALL):
Expand Down
2 changes: 1 addition & 1 deletion src/cloudsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
extern "C" {
#endif

#define CLOUDSYNC_VERSION "1.0.19"
#define CLOUDSYNC_VERSION "1.0.20"
#define CLOUDSYNC_MAX_TABLENAME_LEN 512

#define CLOUDSYNC_VALUE_NOTSET -1
Expand Down
Loading
Loading