[issue37101] Filterer.filter can be rewritten using built-ins just as efficient much more readable

Dale Visser report at bugs.python.org
Fri May 31 09:26:16 EDT 2019


Dale Visser <dale.visser at live.com> added the comment:

It is with great surprise and sadness that I report that I found that performance measurements don't support merging this change. I'm attaching my performance test script. I ran it with/without the logging filters for 1000000 iterations, e.g., ./python all 1000000

The results on my system were as follows, where the numbers may be interpreted as milliseconds per 1000 log messages:		
		
          No Filters    3 Filters
master    17.9          19.8
CBO-37101 19.6          23.1

I imagine I could put a guard 'if' statement that would restore the 'no filters' performance to match 'master', but my use of generators apparently causes the use of significantly more cycles than the existing code.

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed
Added file: https://bugs.python.org/file48381/test_filter_perf.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37101>
_______________________________________


More information about the Python-bugs-list mailing list