Since ancient times, we have been calling curl_global_init with the
CURL_GLOBAL_ALL-flag, which initializes SSL (and the Win32 socket
stack on Windows).

Initializing SSL takes quite some time on Windows, so let's avoid
doing it when it's not needed.

timing of echo "" | ./git-remote-http.exe origin http://localhost


best of 10 runs:
real    0m1.634s
user    0m0.015s
sys     0m0.000s

worst of 10 runs:
real    0m2.701s
user    0m0.000s
sys     0m0.000s


best of 10 runs:
real    0m0.018s
user    0m0.000s
sys     0m0.000s

worst of 10 runs:
real    0m0.024s
user    0m0.000s
sys     0m0.015s

Signed-off-by: Erik Faye-Lund <>
 http.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/http.c b/http.c
index 3b312a8..528a736 100644
--- a/http.c
+++ b/http.c
@@ -343,7 +343,8 @@ void http_init(struct remote *remote, const char *url, int 
        git_config(http_options, NULL);
-       curl_global_init(CURL_GLOBAL_ALL);
+       curl_global_init(CURL_GLOBAL_WIN32 | (prefixcmp(url, "https:") ? 0 :
+           CURL_GLOBAL_SSL));
        http_proactive_auth = proactive_auth;

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at

Reply via email to