squeeze out some performance
Mark Lawrence
breamoreboy at yahoo.co.uk
Mon Dec 9 09:52:54 EST 2013
On 09/12/2013 14:19, Robert Voigtländer wrote:
> Am Samstag, 7. Dezember 2013 00:01:49 UTC+1 schrieb Dan Stromberg:
>> On Fri, Dec 6, 2013 at 2:38 PM, Mark Lawrence <bream... at yahoo.co.uk> wrote:
>>
>>
>> On 06/12/2013 16:52, John Ladasky wrote:
>>
>>
>> On Friday, December 6, 2013 12:47:54 AM UTC-8, Robert Voigtländer wrote:
>>
>>
>>
>>
>> I try to squeeze out some performance of the code pasted on the link below.
>>
>> http://pastebin.com/gMnqprST
>>
>>
>>
>>
>> Several comments:
>>
>>
>>
>> 1) I find this program to be very difficult to read, largely because there's a whole LOT of duplicated code. Look at lines 53-80, and lines 108-287, and lines 294-311. It makes it harder to see what this algorithm actually does. Is there a way to refactor some of this code to use some shared function calls?
>>
>>
>>
>>
>>
>>
>>
>> A handy tool for detecting duplicated code here http://clonedigger.sourceforge.net/ for anyone who's interested.
>>
>>
>>
>> Pylint does this too...
>
> Thanks again. I'll try to compress the code and have a look at the "multiple comparisons" topic.
>
> Robert
>
Would you be kind enough to compress your messages while you're at it by
reading and actioning https://wiki.python.org/moin/GoogleGroupsPython
thanks, a quick glance above will tell you why :)
--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.
Mark Lawrence
More information about the Python-list
mailing list