git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] http_init: only initialize SSL for https
@ 2013-03-14 13:51 Erik Faye-Lund
  2013-03-14 13:56 ` Erik Faye-Lund
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Erik Faye-Lund @ 2013-03-14 13:51 UTC (permalink / raw)
  To: git; +Cc: msysgit

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

before

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

after

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 <erik.faye-lund@hue.no>
---
 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 proactive_auth)
 
 	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;
 
-- 
1.8.0.msysgit.0.3.gd0186ec

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-03-18 12:15 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-14 13:51 [PATCH/RFC] http_init: only initialize SSL for https Erik Faye-Lund
2013-03-14 13:56 ` Erik Faye-Lund
2013-03-14 15:23 ` Johannes Schindelin
2013-03-14 15:36   ` Erik Faye-Lund
2013-03-14 16:46     ` Junio C Hamano
2013-03-14 22:35       ` Johannes Schindelin
2013-03-14 22:45         ` Junio C Hamano
2013-03-14 23:00           ` Erik Faye-Lund
2013-03-15 10:08           ` Daniel Stenberg
2013-03-15 15:59             ` Junio C Hamano
2013-03-15 16:23               ` Daniel Stenberg
2013-03-16 12:03                 ` Jeff King
2013-03-16 22:58                   ` Daniel Stenberg
2013-03-17 17:41                     ` Antoine Pelisse
2013-03-17 22:11                       ` Daniel Stenberg
2013-03-17 22:27                         ` Junio C Hamano
2013-03-18 10:38                           ` Erik Faye-Lund
2013-03-18 12:14                             ` Erik Faye-Lund
2013-03-14 16:04 ` Junio C Hamano
2013-03-14 16:57   ` Johannes Schindelin
2013-03-14 17:28     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).