Skip to content
New issue

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

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

Already on GitHub? # to your account

Response.clone() is slower than returning a new Response #24766

Closed
huseeiin opened this issue Jul 27, 2024 · 0 comments · Fixed by #24812
Closed

Response.clone() is slower than returning a new Response #24766

huseeiin opened this issue Jul 27, 2024 · 0 comments · Fixed by #24812
Assignees
Labels
ext/http related to ext/http perf performance related

Comments

@huseeiin
Copy link

Version: Deno 1.44.4

this is faster:

Deno.serve(() => new Response("hi"));

oha -n 10000 http://localhost:8000/
req/s: 38k

and this is slower:

const hi = new Response("hi");

Deno.serve(() => hi.clone());

oha -n 10000 http://localhost:8000/
req/s: 8k

this didn't make sense to me since Response.clone() should be at least not slower or faster with big responses

@satyarohith satyarohith added perf performance related ext/http related to ext/http labels Jul 29, 2024
@lucacasonato lucacasonato self-assigned this Jul 31, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ext/http related to ext/http perf performance related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants