Skip to content

feat(harness): add granular benchmark phase metrics#1124

Open
HayatoKanee wants to merge 1 commit intotlsnotary:mainfrom
HayatoKanee:feat/bench-phase-metrics
Open

feat(harness): add granular benchmark phase metrics#1124
HayatoKanee wants to merge 1 commit intotlsnotary:mainfrom
HayatoKanee:feat/bench-phase-metrics

Conversation

@HayatoKanee
Copy link
Copy Markdown

@HayatoKanee HayatoKanee commented Mar 11, 2026

Closes #853

Summary

  • add granular per-phase benchmark telemetry for prover benchmarks
  • record phase time, uploaded/downloaded bytes, and IO wait in CSV output
  • add matching tracing instrumentation and shared telemetry contracts
  • harden browser benchmark startup for proxied environments

What changed

  • add stable benchmark phases for preprocess, handshake subphases, record-layer flush, finalization, and transcript proving
  • extend harness metrics and CSV schema with flat phase_* columns
  • upgrade the harness meter to track bytes plus read/write wait time
  • wire telemetry through prover, MPC-TLS, and proving paths
  • make browser executor startup more robust by fixing DevTools binding, adding startup/RPC timeouts, and bypassing proxies for local DevTools lookup

Validation

  • cargo test -p tlsn-harness-core -p tlsn-harness-executor -p tlsn-mpc-tls -p tlsn --lib --no-fail-fast
  • cargo test -p tlsn-harness-runner --no-run
  • native benchmark smoke passed
  • browser benchmark smoke passed
  • native and browser CSV outputs both contain populated phase_* fields with identical headers

Example phase timings from the first cable sample:

Native

  • phase_preprocess_setup_time_ms=13174
  • phase_handshake_ke_online_time_ms=41
  • phase_handshake_prf_session_keys_time_ms=162
  • phase_handshake_record_setup_time_ms=21
  • phase_handshake_prf_server_finished_time_ms=43
  • phase_handshake_prf_client_finished_time_ms=43
  • phase_record_layer_flush_time_ms=295
  • phase_finalize_tls_auth_time_ms=54
  • phase_prove_transcript_time_ms=415

Browser

  • phase_preprocess_setup_time_ms=13609
  • phase_handshake_ke_online_time_ms=96
  • phase_handshake_prf_session_keys_time_ms=166
  • phase_handshake_record_setup_time_ms=83
  • phase_handshake_prf_server_finished_time_ms=54
  • phase_handshake_prf_client_finished_time_ms=54
  • phase_record_layer_flush_time_ms=474
  • phase_finalize_tls_auth_time_ms=63
  • phase_prove_transcript_time_ms=799

Notes

  • phase metrics are emitted to CSV in this PR
  • plot support remains coarse-only and is not changed here
  • the example timings above are from smoke runs and are included to show the new output shape, not as stable performance claims

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.

Improve benchmark granularity

1 participant