Skip to content

Benchmarks#925

Draft
pblazej wants to merge 24 commits intomainfrom
blaze/bench
Draft

Benchmarks#925
pblazej wants to merge 24 commits intomainfrom
blaze/bench

Conversation

@pblazej
Copy link
Contributor

@pblazej pblazej commented Feb 25, 2026

No description provided.

feat: add LiveKit benchmark suite with connection performance tests

test: add data channel latency benchmarks to measure round-trip times

feat: add benchmarks for RPC latency and track publishing performance
refactor: implement Tracer protocol and Span class for structured timing
@github-actions
Copy link

github-actions bot commented Feb 25, 2026

⚠️ This PR does not contain any files in the .changes directory.

pblazej and others added 20 commits February 25, 2026 13:50
…tup/teardown hooks

- Collapse InfrastructureMode into cloud(region:) associated value with URL auto-detection
- Rename BenchmarkStopwatch to BenchmarkTracer for clarity
- Replace custom LockIsolated with SDK's StateSync in EchoParticipant
- Rewrite TokenGenerator to use LiveKitUniFFI instead of manual JWT/CommonCrypto
- Remove unused TrackPublishBenchmark (requires audio hardware unavailable in CLI)
- Extract registerDataChannelBenchmark/registerRpcBenchmark helpers to deduplicate
- Use Benchmark setup/teardown hooks so room connections run outside measurement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- BenchmarkConfig falls back to localhost/devkey/secret when env vars
  are unset, fixing discovery-phase crashes and removing boilerplate
- Remove redundant LIVEKIT_URL/API_KEY/API_SECRET from CI env
- Remove push trigger; benchmarks run on schedule and manual dispatch

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…pwatch API

- Rename Span.name → Span.label and add split(label:)/splits compat API
- Add Equatable conformance to Span and Span.Entry
- Add NoopTracer (default in release) and LoggingTracer (default in debug)
- Stopwatch is now a typealias for Span, preserving old public API
- Keep connectStopwatch property name to avoid breaking changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Benchmark-specific microsecond conversion doesn't belong on the core
Span type. Moved to a package-local extension in BenchmarkTracer.swift.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Simplify Tracer from a span registry (create/hold/end) to a pure factory
(create and forget). Spans now own their lifecycle via an onEnd closure,
matching the OpenTelemetry SpanProcessor pattern.

- Rename protocol Tracer -> Tracing, file Stopwatch.swift -> Tracing.swift
- Add Span.onEnd closure + double-end guard, remove tracer back-reference
- Simplify NoopTracer/LoggingTracer to stateless factories
- Update BenchmarkTracer to wire onEnd for completed span capture
- Deprecate Stopwatch typealias, split(), and splits property
- Fix internal usages to use Span type directly

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The logging overhead is minimal (one debug log on span end), so a
separate no-op implementation is unnecessary. Also flatten
BenchmarkTracer's single-field State struct to a direct StateSync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add benchmark job to CI by calling benchmark.yaml as a reusable
workflow. Add workflow_call trigger to benchmark.yaml to support this.

TODO: Remove the benchmark job from ci.yaml after the refactor merges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… payloads

Replace 2-size payload testing (100B, 14KB) with 3-tier realistic payloads
(200B, 4KB, 15359B) matching actual LiveKit traffic patterns. Expand DC
benchmarks to full reliable×lossy matrix and RPC benchmarks to include
scaled processing delays. Connection benchmark uses per-instance 25
iterations while DC/RPC use global 100.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ean markdown

- Add D_SIGNAL and D_TRANSPORT to connection benchmark metrics config so
  package-benchmark actually collects and reports them
- Split CI into baseline update + baseline read to avoid ANSI progress
  bars polluting the job summary markdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Contributor

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

import Foundation

/// Configuration for benchmark runs, read from environment variables.
struct BenchmarkConfig {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have similar code for other use cases ? like integration tests ?

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.

2 participants