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>
pull/23391/head
Florin-Cristian Gavrila 2015-01-13 18:40:05 +00:00 committed by Julien Gilli
parent d01a900078
commit 8bcd0a4c4a
1 changed files with 0 additions and 4 deletions

View File

@ -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();