martinblech/xmltodict — pull request #56 by HansWeltar (2014-03-27 09:22:27+00:00)
Title: Improve performance for large files

xmltodict becomes slow when you have an XML file with large texts.
Enabling the parser.buffer_text option dramatically increases performance.
Benchmark below. Unittests still work.

Code used to benchmark:

import xmltodict
import time
xml = "" + ("a"*70+"\n")*10000 + ""
s=time.time()
x=xmltodict.parse(xml)
print(time.time() - s)

# 19.9860811234 seconds without buffer_text
# 0.059289932251 seconds with buffer_text
# So 300 times faster