perf: add real HTTP client benchmarks - #75
Conversation
|
Warning Review limit reached
More reviews will be available in 35 minutes and 15 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a full benchmark infrastructure to the ChangesBenchmark Infrastructure
README Cleanup
Sequence Diagram(s)sequenceDiagram
participant CLI as bench/main.dart
participant Server as BenchmarkServer
participant Suite as oxySuite / httpSuite / dioSuite
participant Runner as measureSuites
CLI->>Server: startBenchmarkServer()
CLI->>Runner: measureSuites(config, suites)
Runner->>Suite: measureCase(RunConfig)
Suite->>Server: HTTP GET/POST /empty, /json, /bytes-64k
Server-->>Suite: 200 response (body/status)
Suite-->>Runner: BenchmarkResult(runtimeMicros)
Runner-->>CLI: List<BenchmarkResult>
CLI->>Suite: closeOxyBenchmarks() / closeHttpBenchmarks() / closeDioBenchmarks()
CLI->>Server: closeBenchmarkServer()
CLI->>CLI: printReport(config, results)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 650c09f8b2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@bench/oxy.dart`:
- Around line 11-49: The GET request benchmarks in oxy.dart (get-empty,
get-json-decode, and get-bytes-64k) are missing the headers that are included in
the POST requests and in the corresponding benchmarks in http.dart and dio.dart,
making cross-client comparisons unfair. Add the same headers parameter to all
GET requests that are already being used in the post-bytes-64k request (such as
_octetHeaders) to ensure consistent request shapes across all client test
suites.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9c5ecd27-d504-415e-8d5f-95ff9c43ab63
📒 Files selected for processing (10)
README.mdbench/baseline.dartbench/dio.dartbench/http.dartbench/main.dartbench/oxy.dartbench/src/data.dartbench/src/runner.dartbench/src/server.dartpubspec.yaml
💤 Files with no reviewable changes (1)
- README.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 319d2e2511
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Add a local benchmark harness for Oxy and comparable Dart HTTP clients:
bench/main.dartis the single runner entrypoint with quick/full modes, suite selection, filtering, and JSON output.bench/baseline.dartmeasures lower-level JSON, bytes,ht.Headers, andht.Bodycosts.bench/oxy.dart,bench/http.dart, andbench/dio.dartcompare real client requests against the same loopbackHttpServer.bench/src/server.dartserves fixed GET/POST scenarios and drains plus validates POST request bodies, so upload paths are included in the comparison.Client suites now use the same real network scenarios:
GET /empty,GET /json,GET /bytes-64k,POST /json, andPOST /bytes-64k. This keeps the comparison simple: same local server, same payloads, no mock transports, no custom Dio adapter, and no middleware/interceptor tuning.This remains a local/manual benchmark tool rather than a CI performance gate.
No linked issue; this is a standalone performance benchmark PR.
Validation
dart format --output=none --set-exit-if-changed bench/main.dart bench/oxy.dart bench/http.dart bench/dio.dart bench/src/server.dartdart analyzedart bench/main.dart --quick --jsondart bench/main.dart --quick --suite=clients --jsondart bench/main.dart --suite=clients --jsondart test -p vmdart pub publish --dry-runSummary by CodeRabbit
New Features
Documentation
Chores