Re: [Python-Dev] str.count is slow

2006-03-12 Thread Armin Rigo
Hi Ben, On Mon, Feb 27, 2006 at 06:50:28PM -0500, Ben Cartwright wrote: It seems to me that str.count is awfully slow. Is there some reason for this? stringobject.c could do with a good clean-up. It contains very similar algorithms multiple times, in slightly different styles and with

Re: [Python-Dev] str.count is slow

2006-02-28 Thread James Y Knight
On Feb 28, 2006, at 6:14 PM, Guido van Rossum wrote: On 2/28/06, Greg Ewing [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: My personal goal in life right now is to stay as far away from C++ as I can get. so what C compiler are you using ? Gcc, mostly. I don't mind if it's capable of

Re: [Python-Dev] str.count is slow

2006-02-28 Thread Greg Ewing
Guido van Rossum wrote: Recent versions of GCC appear to be implementing C98 by default -- at least I didn't get complaints about declarations placed after non-declarations in the same block from any of the buildbot hosts... As long as it doesn't complain when I *do* put all my declarations

Re: [Python-Dev] str.count is slow

2006-02-27 Thread Ben Cartwright
From comp.lang.python: [EMAIL PROTECTED] wrote: It seems to me that str.count is awfully slow. Is there some reason for this? Evidence: str.count time test import string import time import array s = string.printable * int(1e5) # 10**7 character string a =

Re: [Python-Dev] str.count is slow

2006-02-27 Thread martin
Zitat von Fredrik Lundh [EMAIL PROTECTED]: it's about time that someone sat down and merged the string and unicode implementations into a single stringlib code base (see the SRE sources for an efficient way to do this in plain C). [1] [...] 1) anyone want me to start working on this ? This

Re: [Python-Dev] str.count is slow

2006-02-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: it's about time that someone sat down and merged the string and unicode implementations into a single stringlib code base (see the SRE sources for an efficient way to do this in plain C). [1] [...] 1) anyone want me to start working on this ? This would be a

Re: [Python-Dev] str.count is slow

2006-02-27 Thread Greg Ewing
Fredrik Lundh wrote: moving to (basic) C++ might also be a good idea (in 3.0, perhaps). is any- one still stuck with pure C89 these days ? Some of us actually *prefer* working with plain C when we have a choice, and don't consider ourselves stuck with it. My personal goal in life right now

Re: [Python-Dev] str.count is slow

2006-02-27 Thread Fredrik Lundh
Greg Ewing wrote: Fredrik Lundh wrote: moving to (basic) C++ might also be a good idea (in 3.0, perhaps). is any- one still stuck with pure C89 these days ? Some of us actually *prefer* working with plain C when we have a choice, and don't consider ourselves stuck with it. perhaps,