histrio / py-couchdb

Modern pure python CouchDB Client.
https://pycouchdb.readthedocs.org/
Other
120 stars 43 forks source link

Always set encoding to utf-8 for better performance #27

Closed jonas-hagen closed 10 years ago

jonas-hagen commented 10 years ago

Thanks a lot for version 1.7!

Not setting the response.encoding to a fixed value causes the requests library to make a costly guess of the encoding (the first time response.text is accessed but even for json it can be utf-8, utf-16 ...).

This leads to a factor three in time needed to get a document from CouchDB. I haven't realized that in the first place. So this fix gives a small performance boost.

niwinz commented 10 years ago

Thanks!