niwibe/py-couchdb — pull request #35 by dpk (2014-07-07 13:50:54+00:00)
Title: speed up JSON decoding by eliminating accidental calls to chardet

The `utils.as_json` method in pycouchdb is extremely slow because it uses `response.text`, which causes the requests module to call chardet, which is a complete waste of time because CouchDB never returns anything except UTF-8. This commit uses `response.content` instead, which is much faster.

In an app which queries a medium-size result (~620 rows, `include_docs=true`), I saw page-load times decrease from 6.10 seconds to 0.2 seconds.