ctype performance benchmark

Duncan Booth duncan.booth at invalid.invalid
Fri Jul 17 15:49:54 EDT 2009


Wai Yip <aurora00 at gmail.com> wrote:

> I started with ctypes because it is the battery included with the
> Python standard library. My code is very fluid and I'm looking for
> easy opportunity to optimize it. One example is to find the longest
> common prefix among two strings. Right now I am comparing it character
> by character with pure Python. It seems like an ideal low hanging
> fruit. With ctype I can rewriting a few lines of Python into a few
> lines of C. All the tools are available and no third party library is
> needed.

Alternatively you could just use os.path.commonprefix().




More information about the Python-list mailing list