[issue21448] Email Parser use 100% CPU

Serhiy Storchaka report at bugs.python.org
Sun Aug 3 20:28:13 CEST 2014


Serhiy Storchaka added the comment:

Yes, but if n is limited, O(n) becomes O(1). In our case n is the number of fed but not read lines. I suppose the worst case is a number of empty lines, in this case n=8192. I tried following microbenchmark and did not noticed significant difference.

$ ./python -m timeit -s "from email.parser import Parser; d = 'From: example at example.com\n\n' + '\n' * 100000" -- "Parser().parsestr(d)"

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21448>
_______________________________________


More information about the Python-bugs-list mailing list