[issue10667] collections.Counter object in C

2010-12-15 Thread Raymond Hettinger
Raymond Hettinger added the comment: Fixed "if(" spacing and applied in r87265. -- resolution: -> fixed status: open -> closed ___ Python tracker ___ __

[issue10667] collections.Counter object in C

2010-12-14 Thread Gregory P. Smith
Gregory P. Smith added the comment: rhettinger's fastcount.patch looks good to me. a couple style nits but they're minor. no space between if and (? yuck. short variable names like "it"? yuck. but the code looks good otherwise. i'm all for it. -- nosy: +gregory.p.smith ___

[issue10667] collections.Counter object in C

2010-12-14 Thread Raymond Hettinger
Raymond Hettinger added the comment: Attaching a new patch for high-speed update() and __init__(). I also tried a C version of __missing__() but the speed-up was too small to be worth it. -- resolution: later -> stage: -> patch review versions: +Python 3.2 -Python 3.3 Added file: ht

[issue10667] collections.Counter object in C

2010-12-10 Thread Justin Peel
Justin Peel added the comment: Okay, I was done submitting. I thought that Antoine was asking for a version that kept a pure Python version so I did that. -- ___ Python tracker ___

[issue10667] collections.Counter object in C

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I would like this API to "sit and cook" for a good while. There are many possible ways to add more methods and most be end-up being YAGNI. Also, my experience with dict.fromkeys() is that a fair number of people get confused by alternative constructors.

[issue10667] collections.Counter object in C

2010-12-10 Thread Justin Peel
Justin Peel added the comment: I've done as Antoine asked and made a pure Python PyCounter class and a C-enhanced Counter class that both use the mixin CounterBase class. I also added to the tests so that both PyCounter and Counter are tested. I left the update_fromsubs() method in Counter fo

[issue10667] collections.Counter object in C

2010-12-10 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue10667] collections.Counter object in C

2010-12-10 Thread Daniel Urban
Changes by Daniel Urban : -- nosy: +durban ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue10667] collections.Counter object in C

2010-12-09 Thread Antoine Pitrou
Antoine Pitrou added the comment: When adding some C accelerations, we often try to keep a pure Python alternative in the stdlib, since it can then benefit other Python implementations (and easy prototyping). If you move some of the methods inside a mixin and use multiple inheritance with th

[issue10667] collections.Counter object in C

2010-12-09 Thread Raymond Hettinger
Changes by Raymond Hettinger : Added file: http://bugs.python.org/file19993/time_counter.py ___ Python tracker ___ ___ Python-bugs-list mailin

[issue10667] collections.Counter object in C

2010-12-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the patch. FWIW, I'm attaching some timing code that I've used in the past. -- assignee: -> rhettinger ___ Python tracker ___ _

[issue10667] collections.Counter object in C

2010-12-09 Thread Justin Peel
New submission from Justin Peel : I put the Counter's update and __missing__ methods into C code. The rest of the existing methods remain the same. The new Counter is at least 2x-10x (or more) faster for updating depending on the input. I also added a new method, update_fromsubs, which is docu