Skip to content

Commit 8bcd0a4

Browse files
CGavrilaJulien Gilli
authored and
Julien Gilli
committed
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: nodejs/node-v0.x-archive#9026 Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
1 parent d01a900 commit 8bcd0a4

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

lib/http.js

-4
Original file line numberDiff line numberDiff line change
@@ -946,10 +946,6 @@ OutgoingMessage.prototype.end = function(data, encoding) {
946946
if (encoding === 'hex' || encoding === 'base64')
947947
hot = false;
948948

949-
// Transfer-encoding: chunked responses to HEAD requests
950-
if (this._hasBody && this.chunkedEncoding)
951-
hot = false;
952-
953949
if (hot) {
954950
// Hot path. They're doing
955951
// res.writeHead();

0 commit comments

Comments
 (0)