[Patches] [ python-Patches-491936 ] Opt for tok_nextc

noreply@sourceforge.net noreply@sourceforge.net
Sat, 09 Mar 2002 04:00:16 -0800


Patches item #491936, was opened at 2001-12-12 09:00
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=491936&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: David Jacobs (dbj)
Assigned to: Nobody/Anonymous (nobody)
Summary: Opt for tok_nextc

Initial Comment:
tokenizer.c - revision 2.53

I tried to pick a routine that looked like it was 
heavily used and optimizations that do not increase 
the maintenance burden (I wont feel bad if you reject 
it though, I'll keep on trying as long as you don't 
consider it a burden :-).

I changed one strcpy to a memcpy because the length 
had already been computed.

I also changed the pattern:
a = strchr(b,'\0');
to
a = b + strlen(b);

Which is an idiom I've seen in many other places in 
the code so I don't think it makes it harder to 
understand and strlen is significantly more efficient 
than strchr.

Aloha,
David Jacobs (your pico optimizer :-)

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-03-09 13:00

Message:
Logged In: YES 
user_id=21627

Can you report some data about the resulting speedup? I
seriously doubt that this is a significant change; unless
data is forthcoming proving me wrong, I recommend to reject
this patch.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=491936&group_id=5470