GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — http: send Content-Length when possible by tellnes · Pull Request #1062 · nodejs/node

Conversation

@tellnes

@tellnes tellnes commented Mar 4, 2015

Copy link
Copy Markdown
Contributor

This changes the behavior for http to send send a Content-Length header instead of using chunked encoding when we know the size of the body when sending the headers.

There is tree commits here. The first one is the initial implementation. The second also sends Content-Length: 0 when there is no body. The last reorganizes some code. I'll squash them before merge.

This broke a lot less tests than I feared.
Fixes #1044

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mscdex

mscdex commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

Do you have performance numbers on how this affects things? I would guess it would be faster since it's not having to do extra encoding....

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tellnes

tellnes commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

I've run the benchmark for http, but I'm not that familiar with the inner workings of those. This is run on my MBP. I do not know how sensitive those are to me surfing Github while it was running.

https://gist.github.com/tellnes/05012feaede66610cf24

It looks like something is going up while other things is going down. Maybe someone with more experience in this area can shim in?

cc @iojs/collaborators

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

You might do something like this from the project root that contains the new changes:

./iojs benchmark/compare.js -r -g ./iojs ./iojs-prev -- http

(where ./iojs-prev is the path to a binary before the changes -- I usually use a full path including the /out/Release/iojs part to make sure a symlink doesn't mistakenly point to the new executable). This will make the output easier to compare.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnoordhuis
bnoordhuis reviewed Mar 5, 2015
View reviewed changes
Comment thread lib/_http_outgoing.js

@bnoordhuis bnoordhuis Mar 5, 2015

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Can you create the _contentLength field in the OutgoingMessage constructor? Adding properties post facto causes a hidden class transition.

EDIT: Sorry, scratch that. I see you're already doing that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bnoordhuis

bnoordhuis commented Mar 5, 2015

Copy link
Copy Markdown
Member

LGTM, no comments.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rvagg

rvagg commented Mar 5, 2015

Copy link
Copy Markdown
Member

nice work, LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tellnes

tellnes commented Mar 5, 2015

Copy link
Copy Markdown
Contributor Author

Here is some numbers: https://gist.github.com/tellnes/44f09e07ac28acf8fc32

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mikeal

mikeal commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

+1

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mscdex

mscdex commented Mar 5, 2015

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tellnes
http: send Content-Length when possible
4874182
This changes the behavior for http to send send a Content-Length header
instead of using chunked encoding when we know the size of the body when
sending the headers.

Fixes: nodejs#1044
PR-URL: nodejs#1062
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Rod Vagg <[email protected]>
Reviewed-By: Brian White <[email protected]>
@tellnes
tellnes force-pushed the http-content-length branch from 1e0e702 to 4874182 Compare March 5, 2015 21:21
@tellnes
tellnes merged commit 4874182 into nodejs:v1.x Mar 5, 2015
@tellnes
tellnes deleted the http-content-length branch March 5, 2015 21:22
@rvagg rvagg mentioned this pull request Mar 5, 2015
Release proposal: v1.5.0 #1060
Closed
@Fishrock123 Fishrock123 mentioned this pull request Mar 13, 2015
[PRIORITY] Persistent failures on Windows #1005
Closed
@davepacheco davepacheco mentioned this pull request Mar 22, 2016
Update dependencies for a Node v6 age TritonDataCenter/node-manta#246
Closed
@lrowe lrowe mentioned this pull request Nov 15, 2017
feat(response): set content-type charset default to utf-8 #1416 restify/node-restify#1564
Closed
3 tasks done
@lpinca lpinca mentioned this pull request Mar 4, 2019
doc(http): res.write(data) followed by res.end() is not actually equivalent to res.end(data) #26005
Closed
@MaxMood96 MaxMood96 mentioned this pull request Jun 22, 2023
[Snyk] Fix for 1 vulnerabilities Mement-Mori/node#28
Open
@baby636 baby636 mentioned this pull request Jun 22, 2023
[Snyk] Fix for 1 vulnerabilities baby636/node#101
Open
@MaxMood96 MaxMood96 mentioned this pull request Jun 22, 2023
[Snyk] Fix for 1 vulnerabilities MaxMood96/node#33
Open
@leonardoadame leonardoadame mentioned this pull request Jul 7, 2023
[Snyk] Fix for 11 vulnerabilities leonardoadame/node#68
Open
@MaxMood96 MaxMood96 mentioned this pull request Nov 27, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 MaxMood96/node#35
Open
@ryan-ally ryan-ally mentioned this pull request Nov 27, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 ryan-ally/node#88
Open
@baby636 baby636 mentioned this pull request Nov 28, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 baby636/node#108
Open
@MaxMood96 MaxMood96 mentioned this pull request Nov 28, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 Mement-Mori/node#32
Open
@aliscco aliscco mentioned this pull request Nov 30, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 aliscco/alisco-node#851
Open
@leonardoadame leonardoadame mentioned this pull request Dec 1, 2023
[Snyk] Security upgrade pkg from 4.3.4 to 5.0.0 leonardoadame/node#347
Open
@leonardoadame leonardoadame mentioned this pull request Dec 19, 2023
[Snyk] Fix for 4 vulnerabilities leonardoadame/node#583
Open
@ryan-ally ryan-ally mentioned this pull request Dec 19, 2023
[Snyk] Fix for 6 vulnerabilities ryan-ally/node#98
Open
@baby636 baby636 mentioned this pull request Dec 20, 2023
[Snyk] Fix for 6 vulnerabilities baby636/node#124
Open
This was referenced Dec 20, 2023
[Snyk] Fix for 6 vulnerabilities MaxMood96/node#40
Open
[Snyk] Fix for 6 vulnerabilities Mement-Mori/node#36
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@tellnes @mscdex @bnoordhuis @rvagg @mikeal
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.