Sudoku solver
BartC
bc at freeuk.com
Sun Mar 29 17:59:47 EDT 2015
On 29/03/2015 22:19, Mark Lawrence wrote:
> On 29/03/2015 21:59, BartC wrote:
>> On 29/03/2015 00:12, Chris Angelico wrote:
>>> On Sun, Mar 29, 2015 at 10:50 AM, BartC <bc at freeuk.com> wrote:
>>>> Using the OP's algorithm, and testing with the 'hard' puzzle posted
>>>> by Ian
>>>> Kelly, I got these approximate results:
>>>>
>>>> Python 3.1: 1700 seconds (normal Python interpreter)
>>>> PyPy: 93 seconds
>>>> C unoptimised: 17 seconds (gcc -O0 32-bit)
>>>> C optimised: 3.3 seconds (gcc -O3 32-bit)
>>>> (X: 170 seconds)
>>>
>>> Nice stats. Any chance you can add CPython 3.4 or 3.5 to that? That's
>>> a pretty old CPython you're using.
>>
>> I've tried 3.4.3 and it's nearer 1900 seconds!
>>
>> Which wasn't too surprising as you don't expect new releases to be
>> faster, they tend to be slower.
> I simply do not believe those figures, that's roughly 12% slower. If
> that happened in the real world you'd be able to hear the screams of
> anguish around the world.
You're right, it's wasn't 12% slower. It was 16%!
I didn't have time to run this very long benchmark so ran a different
algorithm using 3.1, averaging 14.1 seconds for 3 runs. And ran the same
code with 3.4.3, average 16.4 seconds.
Maybe most people don't run intensively computational benchmarks like these.
--
Bartc
More information about the Python-list
mailing list