diff options
author | Florin-Cristian Gavrila <cristi_gavrila1@yahoo.com> | 2015-01-13 18:40:05 +0000 |
---|---|---|
committer | Julien Gilli <julien.gilli@joyent.com> | 2015-03-05 11:16:52 -0800 |
commit | 8bcd0a4c4a8e3d748bea53d036985609ea634b8d (patch) | |
tree | 08210fddb8e808f466a96eff8b539734e2196f81 | |
parent | d01a900078abe4ea6159bc827ee0189a04459c8a (diff) | |
download | node-8bcd0a4c4a8e3d748bea53d036985609ea634b8d.tar.gz |
http: fix performance regression for GET requests
A significant performance regressions has been introduced in 1fddc1f for
GET requests which send data through response.end(). The number of
requests per second dropped to somewhere around 6% of their previous
level.
The fix consists of removing a part of the lines added by 1fddc1f,
lines which were supposed to affect only HEAD requests, but interfered
with GET requests instead.
The lines removed would not have affected the behaviour in the case of
a HEAD request as this._hasBody would always be false. Therefore, they
were not required to fix the issue reported in #8361.
Fixes #8940.
PR: #9026
PR-URL: https://github.com/joyent/node/pull/9026
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
-rw-r--r-- | lib/http.js | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/http.js b/lib/http.js index 6f640d1af..f4e8db7de 100644 --- a/lib/http.js +++ b/lib/http.js @@ -946,10 +946,6 @@ OutgoingMessage.prototype.end = function(data, encoding) { if (encoding === 'hex' || encoding === 'base64') hot = false; - // Transfer-encoding: chunked responses to HEAD requests - if (this._hasBody && this.chunkedEncoding) - hot = false; - if (hot) { // Hot path. They're doing // res.writeHead(); |