Created attachment 5027 [details]
Reported on behalf of a user.
## Steps to reproduce
1. Open and run the attached test case.
2. Push the "Click" button.
3. Notice how long the app takes before writing the response into the TextView.
4. Stop the app.
5. Uncomment one of the "Using HttpsURLConnection" or "Using AndroidHttpClient" regions, and comment out the "Using HttpClient" region.
6. Run the app again, and repeat steps 2 and 3.
`HttpsURLConnection` and `AndroidHttpClient` complete the request noticeably more quickly than `HttpClient`.
## Additional information
- At least in the user's full app, compiling in release mode and running on-device did not change the result.
- Plain HTTP requests are markedly faster than HTTPS requests. If there is a difference between `HttpClient` and the other options when performing HTTP requests, it is difficult to notice.
- Clicking the button a second time will send a second HTTPS request to a different server. If you switch the "google" and "facebook" URLs, the second ("google") request completes more quickly than when the "google" request runs first. This might vaguely suggest the involvement of a reverse DNS lookup bug from Android , except that:
1. The project is currently set to use Jelly Bean, so the bug should be fixed.
2. The "Using AndroidHttpClient" version shows no problem.
## Version information
Sounds like a JIT overhead issue.
This should be improved slightly in 4.14 (by moving much of the HTTPS stack into mscorlib.dll), but even then this will require JIT'ing the entire HTTPS stack in order to make the initial request -- Security, crypto, etc., etc. -- all of which the Android types won't require.
This will be improved once we offer AOT support.
This is expected, full managed implementation will be always slower than implementation which reuses native parts.
We could try to look into making the code faster but as we already have fast (AndroidHttpClient) implementation available I don't strong motivation to do it