JDK-8072586 : HttpURLConnection.setFixedLengthStreamingMode() performance regression
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.net
  • Affected Version: 8u31
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-01-29
  • Updated: 2022-07-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
NAME=Fedora
VERSION="20 (Heisenbug)"
ID=fedora
VERSION_ID=20
PRETTY_NAME="Fedora 20 (Heisenbug)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:20"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"


A DESCRIPTION OF THE PROBLEM :
When the fixedContentLength is set with HttpURLConnection.setFixedLengthStreamingMode(),
sun.net.www.protocol.http.HttpURLConnection.getOutputStream() is about 6 times slower than the jdk7u25 with fixedLengthStreamingMode is enabled. I checked several jdk7 version , this is introduced since jdk7u40. 

This performance regression can be reproduced with code : https://github.com/jimma/jdk7u40-httpurlconnection-issue.git

ADDITIONAL REGRESSION INFORMATION: 
This works in jdk7u25. 

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
git clone https://github.com/jimma/jdk7u40-httpurlconnection-issue.git
mvn clean install 
compare the output result with setFixedLengthStreamingMode() and without setFixedLengthStreamingMode()


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
https://github.com/jimma/jdk7u40-httpurlconnection-issue.git
---------- END SOURCE ----------


Comments
Probably related to the liveness check introduced in JDK-7199862
04-07-2022

Checked the performance with JDK 7u76 and 8u31 while comparing with JDK 8u31 and could reproduce the issue. Use the attached test case file to reconfirm.
05-02-2015