Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arglist: optimize flush_pre_post() and __init__()
Avoid expensive calls and loops, instead relying as much on Python builtins as possible. Track whether any options need to be deduped at flush_pre_post() time, and if not just concatenate pre, _container and post. Before: ncalls tottime cumtime 19268 0.163 3.586 arglist.py:97(__init__) 45127 0.251 4.530 arglist.py:142(__iter__) 81866 3.623 5.013 arglist.py:108(flush_pre_post) 76618 3.793 5.338 arglist.py:273(__iadd__) After: 35647 0.156 0.627 arglist.py:160(__iter__) 18674 0.211 3.442 arglist.py:97(__init__) 78998 2.627 3.603 arglist.py:116(flush_pre_post) 73774 3.605 5.049 arglist.py:292(__iadd__) Signed-off-by: Paolo Bonzini <[email protected]>
- Loading branch information