[Zope-Coders] x.startswith() vs. x[ ..]

Andreas Jung andreas@andreas-jung.com
Sat, 1 Dec 2001 12:38:48 -0500


I just made a small benchmark comparing  startwith()/endswith() on strings
against the corresponding string slicing.  Using string methods is about 30%
faster
than slicing and sometimes the code is more readable. Maybe we should keep
that in mind for performance reasons when working on Zope 2/3.

Cheers,
Andreas