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-24.12:44:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1424781862.43.0.674356598113.issue23509@psf.upfronthosting.co.za>
In-reply-to
Content
However it is possible to speed up the implementation. Proposed patch increases performance of Counter operators from 20% to 1200%.

Unpatched        Patched

   422 (-3%)         411 c = Counter(a)
   260 (-4%)         251 c = Counter(b)
 15568 (-118%)      7155 c = Counter(a); c + b
 11536 (-56%)       7377 c = Counter(a); c - b
 15354 (-190%)      5291 c = Counter(a); c | b
 11291 (-60%)       7043 c = Counter(a); c & b
  8176 (-22%)       6712 c = Counter(a); c += b
 21976 (-162%)      8379 c = Counter(a); c -= b
  6090 (-24%)       4895 c = Counter(a); c |= b
 16346 (-34%)      12226 c = Counter(a); c &= b
 17125 (-1160%)     1359 +a
 10484 (-289%)      2693 +c  # c = Counter(); c.subtract(a)
  3325 (-234%)       997 -a
 10094 (-56%)       6480 -c  # c = Counter(); c.subtract(a)
History
Date User Action Args
2015-02-24 12:44:22serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, joern
2015-02-24 12:44:22serhiy.storchakasetmessageid: <1424781862.43.0.674356598113.issue23509@psf.upfronthosting.co.za>
2015-02-24 12:44:22serhiy.storchakalinkissue23509 messages
2015-02-24 12:44:21serhiy.storchakacreate