[Python-Dev] Optimization versus code bloat

Hye-Shik Chang perky at i18n.org
Mon Dec 29 19:34:08 EST 2003


On Mon, Dec 29, 2003 at 08:01:28AM -0600, Skip Montanaro wrote:
> 
>     Hye-Shik> I posted a patch[1] optimizing str.split with specialized
>     Hye-Shik> splitter as unicode.split do. The patch accellates str.split
>     Hye-Shik> about 10~20% and adds about 50 lines. I'm curious whether it's
>     Hye-Shik> acceptable ratio for python-dev moods.
> 
>     Hye-Shik> [1] http://www.python.org/sf/866875
> 
> Seems like a reasonable addition to me, especially if the same optimization
> is performed for unicode objects.  I'm a bit confused about all the changes
> to test_string.py though.  Since your change is only for performance it
> seems to me that no changes to the test suite would have been necessary
> unless it wasn't covering some critical tests.  Was that just a
> rearrangement of that file or did you add some new test cases?

Nah. Because I added one more specialized splitter, I should add
unittests for that subsequently. So we need to test each test cases
for every specialized splitters (whitespace, string and a character).

Thanks for your review! :-)


Hye-Shik



More information about the Python-Dev mailing list