[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 22/254: curl: set a 100K buffer size by default
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 22/254: curl: set a 100K buffer size by default |
Date: |
Sat, 17 Jun 2017 16:50:54 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit 96ece5c0eef0ca4953ec306e59fd7aa8d48be793
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Apr 24 12:03:08 2017 +0200
curl: set a 100K buffer size by default
Test command 'time curl http://localhost/80GB -so /dev/null' on a Debian
Linux.
Before (middle performing run out 9):
real 0m28.078s
user 0m11.240s
sys 0m12.876s
After (middle performing run out 9)
real 0m26.356s (93.9%)
user 0m5.324s (47.4%)
sys 0m8.368s (65.0%)
Also, doing SFTP over a 200 millsecond latency link is now about 6 times
faster.
Closes #1446
---
src/tool_operate.c | 10 +++++++---
tests/data/test1400 | 1 +
tests/data/test1401 | 1 +
tests/data/test1402 | 1 +
tests/data/test1403 | 1 +
tests/data/test1404 | 1 +
tests/data/test1405 | 1 +
tests/data/test1406 | 1 +
tests/data/test1407 | 1 +
tests/data/test1420 | 1 +
10 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 0e84ac398..724826c8e 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -246,6 +246,8 @@ static void setfiletime(long filetime, const char *filename,
#endif /* defined(HAVE_UTIME) || \
(defined(WIN32) && (CURL_SIZEOF_CURL_OFF_T >= 8)) */
+#define BUFFER_SIZE (100*1024)
+
static CURLcode operate_do(struct GlobalConfig *global,
struct OperationConfig *config)
{
@@ -888,10 +890,12 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt(curl, CURLOPT_SEEKDATA, &input);
my_setopt(curl, CURLOPT_SEEKFUNCTION, tool_seek_cb);
- if(config->recvpersecond)
- /* tell libcurl to use a smaller sized buffer as it allows us to
- make better sleeps! 7.9.9 stuff! */
+ if(config->recvpersecond &&
+ (config->recvpersecond < BUFFER_SIZE))
+ /* use a smaller sized buffer for better sleeps */
my_setopt(curl, CURLOPT_BUFFERSIZE, (long)config->recvpersecond);
+ else
+ my_setopt(curl, CURLOPT_BUFFERSIZE, (long)BUFFER_SIZE);
/* size of uploaded file: */
if(uploadfilesize != -1)
diff --git a/tests/data/test1400 b/tests/data/test1400
index e82084324..0cef18dfd 100644
--- a/tests/data/test1400
+++ b/tests/data/test1400
@@ -68,6 +68,7 @@ int main(int argc, char *argv[])
CURL *hnd;
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1400");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
diff --git a/tests/data/test1401 b/tests/data/test1401
index 34469a376..d6c904088 100644
--- a/tests/data/test1401
+++ b/tests/data/test1401
@@ -80,6 +80,7 @@ int main(int argc, char *argv[])
slist1 = curl_slist_append(slist1, "X-Men: cyclops, iceman");
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1401");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
diff --git a/tests/data/test1402 b/tests/data/test1402
index bf22695e6..c3581287a 100644
--- a/tests/data/test1402
+++ b/tests/data/test1402
@@ -73,6 +73,7 @@ int main(int argc, char *argv[])
CURL *hnd;
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1402");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
diff --git a/tests/data/test1403 b/tests/data/test1403
index 1a0fc7d8f..3a5b1b236 100644
--- a/tests/data/test1403
+++ b/tests/data/test1403
@@ -70,6 +70,7 @@ int main(int argc, char *argv[])
CURL *hnd;
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL,
"http://%HOSTIP:%HTTPPORT/we/want/1403?foo=bar&baz=quux");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
diff --git a/tests/data/test1404 b/tests/data/test1404
index c0bb81b58..c86d2602c 100644
--- a/tests/data/test1404
+++ b/tests/data/test1404
@@ -123,6 +123,7 @@ int main(int argc, char *argv[])
CURLFORM_END);
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1404");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_HTTPPOST, post1);
diff --git a/tests/data/test1405 b/tests/data/test1405
index 041d9f3bd..f3ad3e795 100644
--- a/tests/data/test1405
+++ b/tests/data/test1405
@@ -83,6 +83,7 @@ int main(int argc, char *argv[])
slist3 = curl_slist_append(slist3, "*FAIL HARD");
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/1405");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1);
diff --git a/tests/data/test1406 b/tests/data/test1406
index 6276b9e97..033957f60 100644
--- a/tests/data/test1406
+++ b/tests/data/test1406
@@ -75,6 +75,7 @@ int main(int argc, char *argv[])
slist1 = curl_slist_append(slist1, "address@hidden");
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/1406");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
diff --git a/tests/data/test1407 b/tests/data/test1407
index 6b44cb79a..5a3de1b17 100644
--- a/tests/data/test1407
+++ b/tests/data/test1407
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
CURL *hnd;
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/1407");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
diff --git a/tests/data/test1420 b/tests/data/test1420
index 6183fd659..38139e0b0 100644
--- a/tests/data/test1420
+++ b/tests/data/test1420
@@ -63,6 +63,7 @@ int main(int argc, char *argv[])
CURL *hnd;
hnd = curl_easy_init();
+ curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;UID=1");
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 27/254: examples: ftpuploadfrommem.c, (continued)
- [GNUnet-SVN] [gnurl] 27/254: examples: ftpuploadfrommem.c, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 02/254: bump: start working on next release, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 28/254: url: declare get_protocol_family() static, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 62/254: transfer: fix minor buffer_size mistake, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 40/254: curl_rtmp: fix missing-variable-declarations warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 49/254: getpart: use correct variable type, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 13/254: llist: fix a comment after cbae73e1dd9, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 11/254: multi: clarify condition in curl_multi_wait, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 08/254: llist: no longer uses malloc, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 66/254: krb5: use private buffer for temp string, not receive buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 22/254: curl: set a 100K buffer size by default,
gnunet <=
- [GNUnet-SVN] [gnurl] 34/254: http-proxy: removed unused argument in CURL_DISABLE_PROXY case, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 06/254: mbedtls: enable NTLM (& SMB) even if MD4 support is unavailable, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 20/254: configure: stop prepending to LDFLAGS, CPPFLAGS, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 10/254: lib: fix maybe-uninitialized warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 14/254: configure: fix the -ldl check for openssl, add -lpthread check, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 17/254: nss: adapt to the new Curl_llist API, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 35/254: test1443: test --remote-time, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 12/254: schannel: Don't treat encrypted partial record as pending data, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 58/254: http: don't clobber the receive buffer for timecond, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 15/254: RELEASE-NOTES: synced with c68fed875, gnunet, 2017/06/17