Skip to content

Add Compression Benchmark Scenario#59

Merged
VikramAditya33 merged 1 commit into
mainfrom
fix-compression
Apr 28, 2026
Merged

Add Compression Benchmark Scenario#59
VikramAditya33 merged 1 commit into
mainfrom
fix-compression

Conversation

@VikramAditya33
Copy link
Copy Markdown
Collaborator

@VikramAditya33 VikramAditya33 commented Apr 28, 2026

Added compression benchmark scenario comparing Express, Fastify, and uWestJS

Closes #58

Summary by CodeRabbit

  • Tests
    • Added benchmark scenario for compression functionality across supported frameworks.
    • Added performance testing script for gzip-compressed response scenarios.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2b0e5163-00ea-41d7-b631-7a2690293eb0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-compression

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

uWestJS Benchmark Results

Scenario Express req/s Fastify req/s uWestJS req/s Express throughput Fastify throughput uWestJS throughput uWestJS vs Express uWestJS vs Fastify
compression 6.08k 4.33k FAILED 3.19 MB/s 2.22 MB/s FAILED N/A N/A
headers 13.27k 19.52k 43.92k 2.47 MB/s 3.65 MB/s 6.91 MB/s 3.31x 2.25x
hello-world 13.62k 21.72k 51.04k 2.26 MB/s 3.64 MB/s 5.06 MB/s 3.75x 2.35x
json-response 12.76k 18.77k 39.86k 3.48 MB/s 5.14 MB/s 9.73 MB/s 3.12x 2.12x
mixed-response 12.83k 19.12k 35.68k 2.96 MB/s 4.43 MB/s 7.21 MB/s 2.78x 1.87x
post-json 12.70k 11.50k 21.72k 2.35 MB/s 3.14 MB/s 3.69 MB/s 1.71x 1.89x
query-params 11.40k 18.40k 44.32k 2.51 MB/s 4.07 MB/s 5.96 MB/s 3.89x 2.41x
route-params 12.99k 18.80k 37.43k 2.96 MB/s 4.30 MB/s 7.46 MB/s 2.88x 1.99x
static-file 15.73k 20.15k 37.08k 156.12 MB/s 199.76 MB/s 366.99 MB/s 2.36x 1.84x

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@benchmarks/scenarios/compression.js`:
- Around line 29-32: The async route at app.get('/compress') calls
handler.compressBuffer without error handling; wrap the await
handler.compressBuffer(req, res, body) call in a local try/catch inside that
route handler (the function passed to app.get('/compress')), and on catch send a
controlled 500 response (e.g.,
res.status(500).setHeader('content-type','text/plain').send('Compression
failed') or similar) to avoid unhandled rejections and benchmark instability;
keep the existing success path (setHeader and res.send(compressed)) unchanged.
- Around line 11-33: The payload is precomputed as a Buffer only for uwestjs
which skews benchmarking; change to build a single shared Buffer (from payload)
once and use that Buffer for all frameworks: replace Express's string send in
the app.get('/compress') handler (used in the 'express' branch) to send the
prebuilt Buffer (keeping res.type('text/plain') and res.send(buffer)), and
replace Fastify's reply.send(payload) in the 'fastify' branch to
reply.send(buffer) (keep reply.type('text/plain') or equivalent), while leaving
the uwestjs CompressionHandler usage as-is (handler.compressBuffer should still
receive the buffer). Ensure the unique symbols payload, app.get('/compress'),
CompressionHandler, handler.compressBuffer, and reply.send are updated
accordingly.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 12848f94-c12f-4f93-8a46-95278fff7e4a

📥 Commits

Reviewing files that changed from the base of the PR and between 59e1498 and 30b209a.

📒 Files selected for processing (2)
  • benchmarks/scenarios/compression.js
  • benchmarks/wrk-scripts/compression.lua

Comment thread benchmarks/scenarios/compression.js
Comment thread benchmarks/scenarios/compression.js Outdated
@VikramAditya33
Copy link
Copy Markdown
Collaborator Author

Compression Failure is expected as #57 fix isn't at place. Will open a PR soon

@VikramAditya33 VikramAditya33 merged commit 1f2bad7 into main Apr 28, 2026
4 of 5 checks passed
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.

Add Compression Benchmark Scenario

1 participant