Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(http): avoid clone getting request method and url #26250

Merged

Conversation

dsherret
Copy link
Member

Code:

Deno.serve({ port: 8085 }, request => {
  return new Response(request.url);
});

Before:

$ wrk -d60s http://localhost:8085
Running 1m test @ http://localhost:8085
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    65.49us   36.05us   5.46ms   96.33%
    Req/Sec    75.71k     1.90k   79.44k    78.87%
  9053462 requests in 1.00m, 1.36GB read
Requests/sec: 150641.83
Transfer/sec:     23.13MB

After:

$ wrk -d60s http://localhost:8085
Running 1m test @ http://localhost:8085
  2 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    64.72us   38.14us   3.29ms   95.97%
    Req/Sec    76.66k     1.85k   80.17k    77.45%
  9168694 requests in 1.00m, 1.37GB read
Requests/sec: 152557.21
Transfer/sec:     23.42MB

@dsherret dsherret requested a review from littledivy October 14, 2024 20:54
Copy link
Member

@littledivy littledivy left a comment

Choose a reason for hiding this comment

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

LGTM, nice!

@dsherret dsherret merged commit 7f3747f into denoland:main Oct 15, 2024
17 checks passed
@dsherret dsherret deleted the chore_avoid_clone_request_properties branch October 15, 2024 03:25
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