A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-June/004730.html below:

[Python-Dev] talking about performance...

[Python-Dev] talking about performance...M.-A. Lemburg mal@lemburg.com
Sun, 18 Jun 2000 23:48:32 +0200
Fredrik Lundh wrote:
> 
> amk wrote:
> 
> > On Sun, Jun 18, 2000 at 09:06:45PM +0200, Fredrik Lundh wrote:
> > >so in other words, something in unicode land isn't
> > >as efficient as it should...
> >
> > The relevant bit of findstring() in unicodeobject.c:
> >
> >     if (direction < 0) {
> >         for (; end >= start; end--)
> >             if (Py_UNICODE_MATCH(self, end, substring))
> >                 return end;
> >     } else {
> >         for (; start <= end; start++)
> >             if (Py_UNICODE_MATCH(self, start, substring))
> >                 return start;
> >     }
> >
> > And...
> >
> > #define Py_UNICODE_MATCH(string, offset, substring)\
> >     (!memcmp((string)->str + (offset), (substring)->str,\
> >              (substring)->length*sizeof(Py_UNICODE)))
> 
> heh.  it's my own code, of course...
> 
> > Proposed patch:
> >
> > Index: unicodeobject.c
> 
> MATCH is used in a couple of places; it's probably a better idea
> to change the macro (in Include/unicodeobject.h).  MAL?

Right. I'll add Andrew's proposed patch to the macro def.

--
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4