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.
The
utils.as_json
method in pycouchdb is extremely slow because it usesresponse.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 usesresponse.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.