[Tutor] 6x6 word square solver too slow

Alan Gauld alan.gauld at btinternet.com
Fri Apr 25 09:41:07 CEST 2008


"R. Alan Monroe" <amonroe at columbus.rr.com> wrote 

>> That effectively means join is getting called at 6 levels
>> of loop nesting for just one recursive call, but you could
>> be doing more than that.
> 
> I'm doing zip and list comprehension just as often, and they don't
> make a blip in the profiler. Maybe that's a shortcoming of the
> profiler itself?

I wouldn't expect the comprehension to be shown but zip 
is a fair point. I would have expected zip and join to be 
pretty close in resource usage.

>> how many times it gets called altogether - I predict a
>> very big number.... :-)
> 
> A 2000-3000 per go round.

That's not as big as I thought, presumably the dictionary 
isn't that big?

>> However I suspect any attempt to improve performance
>> here needs a new algorithm and probably a clever data
>> structure to minimise brute force tests.
> 
> If I knew of one, I would have used it :)

Ever the problem :-)

Alan G.



More information about the Tutor mailing list