This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients joern, rhettinger, serhiy.storchaka
Date 2015-02-26.08:53:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424940808.32.0.890154108706.issue23509@psf.upfronthosting.co.za>
In-reply-to
Content
Applied optimizations:

1) Used cached get() method instead of indexing. This optimization already was used in update() and subtract().
2) _keep_positive() is optimized for the case when most counts are not positive (common case for substraction and intersection).
3) __add__ and __or__ are defined via inplace operations which are faster (due to fast copying and _keep_positive()).
4) Inlined and simplified the code for __pos__ and __neg__.

May be following optimization can be made by implementing _keep_positive() in C.
History
Date User Action Args
2015-02-26 08:53:28serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, joern
2015-02-26 08:53:28serhiy.storchakasetmessageid: <1424940808.32.0.890154108706.issue23509@psf.upfronthosting.co.za>
2015-02-26 08:53:28serhiy.storchakalinkissue23509 messages
2015-02-26 08:53:28serhiy.storchakacreate