Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Benchmarks

All benchmarks: median of 3 runs × 5 iterations each. Model: gpt-5.4. Environment: macOS (M-series), release mode, warm HTTP/2 connections.

Benchmarks

Rust Ecosystem (openai-oxide vs async-openai vs genai)

Testopenai-oxideasync-openaigenai
Plain text1011ms960ms835ms
Structured output1331msN/A1197ms
Function calling1192ms1748ms1030ms
Multi-turn (2 reqs)2362ms3275ms1641ms
Streaming TTFT645ms685ms670ms
Parallel 3x1165ms1053ms866ms

WebSocket mode (openai-oxide only)

TestWebSocketHTTPImprovement
Plain text710ms1011ms-29%
Multi-turn (2 reqs)1425ms2362ms-40%
Rapid-fire (5 calls)3227ms5807ms-44%

median of medians, 3×5 iterations. Model: gpt-5.4. macOS (M-series), release mode, warm HTTP/2 connections.

Reproduce: cargo run --example benchmark --features responses --release


Python Ecosystem (openai-oxide-python vs openai)

openai-oxide wins 10/12 tests. Native PyO3 bindings vs openai (openai 2.29.0).

Testopenai-oxideopenaiWinner
Plain text845ms997msOXIDE (+15%)
Structured output1367ms1379msOXIDE (+1%)
Function calling1195ms1230msOXIDE (+3%)
Multi-turn (2 reqs)2260ms3089msOXIDE (+27%)
Web search3157ms3499msOXIDE (+10%)
Nested structured5377ms5339mspython (+1%)
Agent loop (2-step)4570ms5144msOXIDE (+11%)
Rapid-fire (5 calls)5667ms6136msOXIDE (+8%)
Prompt-cached4425ms5564msOXIDE (+20%)
Streaming TTFT626ms638msOXIDE (+2%)
Parallel 3x1184ms1090mspython (+9%)
Hedged (2x race)893ms995msOXIDE (+10%)

median of medians, 3×5 iterations. Model: gpt-5.4.

Reproduce: cd openai-oxide-python && uv run python ../examples/bench_python.py


Node.js Ecosystem (openai-oxide vs openai)

openai-oxide wins 8/8 tests. Native napi-rs bindings vs official openai npm.

Testopenai-oxideopenaiWinner
Plain text1075ms1311msOXIDE (+18%)
Structured output1370ms1765msOXIDE (+22%)
Function calling1725ms1832msOXIDE (+6%)
Multi-turn (2 reqs)2283ms2859msOXIDE (+20%)
Rapid-fire (5 calls)6246ms6936msOXIDE (+10%)
Streaming TTFT534ms580msOXIDE (+8%)
Parallel 3x1937ms1991msOXIDE (+3%)
WebSocket hot pair2181msN/AOXIDE

median of medians, 3×5 iterations. Model: gpt-5.4.

Reproduce: cd openai-oxide-node && BENCH_ITERATIONS=5 node examples/bench_node.js

How to run

Rust

cargo run --example benchmark --features responses --release

Python

cd openai-oxide-python && uv run python ../examples/bench_python.py

Node.js

cd openai-oxide-node && BENCH_ITERATIONS=5 node examples/bench_node.js

Methodology

  • Warm connections: First request is a warmup (not measured). All subsequent requests reuse HTTP/2 connections with keep-alive.
  • Median of medians: Each test runs 5 iterations per run, 3 runs total. We report the median of the 3 median values.
  • Same prompts: Both clients send identical requests to the same model.
  • Release mode: Rust benchmarks compiled with --release. Python and Node use prebuilt native extensions.

Updating benchmarks

  1. Edit benchmarks/results.json with new numbers
  2. Run python3 benchmarks/generate.py to regenerate tables
  3. Docs and README include from generated files