libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthonys...@apache.org
Subject [1/2] libcloud git commit: Restore RawResponse speed
Date Thu, 04 May 2017 22:53:30 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk a421668d1 -> 6c0b17f10


Restore RawResponse speed

RawResponse uses response.body from requests, which is pathologically
slow due to chardet (requests#2359). Since we're only interested in the
bytes, using response.content is faster. On a 3Mib file, this makes
a download_object() go from 40s to 4s.

Closes #1053


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/1fecfa0d
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/1fecfa0d
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/1fecfa0d

Branch: refs/heads/trunk
Commit: 1fecfa0d0e3545032e78b0e49965ce75d914e9b6
Parents: a421668
Author: Quentin Pradet <quentin@clustree.com>
Authored: Fri May 5 00:25:17 2017 +0400
Committer: Anthony Shaw <anthonyshaw@apache.org>
Committed: Fri May 5 08:51:58 2017 +1000

----------------------------------------------------------------------
 libcloud/common/base.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/1fecfa0d/libcloud/common/base.py
----------------------------------------------------------------------
diff --git a/libcloud/common/base.py b/libcloud/common/base.py
index 6a9361b..063f52b 100644
--- a/libcloud/common/base.py
+++ b/libcloud/common/base.py
@@ -278,7 +278,7 @@ class RawResponse(Response):
         if not self._response:
             response = self.connection.connection.getresponse()
             self._response = HttpLibResponseProxy(response)
-            self.body = response.text
+            self.body = response.content
             if not self.success():
                 self.parse_error()
         return self._response


Mime
View raw message