[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-20 Thread Collin Winter
Collin Winter added the comment: Committed as r69811. -- resolution: -> accepted status: open -> closed ___ Python tracker ___ ___ Py

[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-19 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: Looks good to me. ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-13 Thread Collin Winter
Changes by Collin Winter : Removed file: http://bugs.python.org/file12962/faster_modulo.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-13 Thread Collin Winter
Collin Winter added the comment: Updated the patch to use only PyString_CheckExact(); added a test for the behaviour of string subclasses wrt the % operator. There's a very slight performance hit when using % with numbers, but it's so small as to be statistically insignificant. If it turns out

[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-06 Thread Jeffrey Yasskin
Jeffrey Yasskin added the comment: I think this is only valid when PyString_CheckExact is true. A subclass could override __mod__, right? I'm somewhat interested to see how a primarily-numeric benchmark responds to this patch. I'd expect it to get very slightly slower for % operations. Probably

[issue5176] Special-case string formatting in BINARY_MODULO implementation

2009-02-06 Thread Collin Winter
New submission from Collin Winter : This patch speeds up the string formatting % operator by avoiding the unnecessary indirection in PyNumber_Remainder(). This particularly benefits templating systems that do a lot of string formatting via %. Performance tested with gcc 4.3.1 x86_64 on Linux 2.6