summaryrefslogtreecommitdiff
path: root/jq.pyx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2020-09-13 16:27:34 +0100
committerMichael Williamson <mike@zwobble.org>2020-09-13 16:27:34 +0100
commit54467df8c6f06c2d4421ab5d0446d7cd8f5040e1 (patch)
treed16b305a5268ee1386150e8c087bb19b7bc55fa5 /jq.pyx
parent006b54f8f8698fd79bc634535664a85aaafc5280 (diff)
Add comment about performance for text()
Diffstat (limited to 'jq.pyx')
-rw-r--r--jq.pyx4
1 files changed, 4 insertions, 0 deletions
diff --git a/jq.pyx b/jq.pyx
index cbb7b5d..7577ae5 100644
--- a/jq.pyx
+++ b/jq.pyx
@@ -254,6 +254,10 @@ cdef class _ProgramWithInput(object):
return _ResultIterator(self._jq_state_pool, self._bytes_input)
def text(self):
+ # Performance testing suggests that using _jv_to_python (within the
+ # result iterator) followed by json.dumps is faster than using
+ # jv_dump_string to generate the string directly from the jv values.
+ # See: https://github.com/mwilliamson/jq.py/pull/50
return "\n".join(json.dumps(v) for v in self)
def all(self):