Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Challenge: "Insanity" Cube Puzzle

by Limbic~Region (Chancellor)
on Jul 06, 2006 at 16:58 UTC ( [id://559626]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Challenge: "Insanity" Cube Puzzle
in thread Challenge: "Insanity" Cube Puzzle

Ieronim,
I told liverpole in the CB that I didn't really have time to play with this but since he indicated I was the reason he posted it as a Challenge (see some of my previous posts), I felt obligated to do so. Without thinking about it too much, I decided just to brute-force it and then see if there were any obvious optimizations on that. I do not expect it to be the fastest but it is fast enough.

With regards to benchmarking, it is almost never a good idea to include IO. Basically, the routines should be verified to produce essentially the same results first and then the output should be omitted. In other words, doing any preparation IO work before the bench, run the bench, and omit any IO output.

Update: Depending on how you count, the following only loops 1,152 times and still finds duplicates.

And the following performs even fewer (< 500):

Cheers - L~R

Replies are listed 'Best First'.
Re^4: Challenge: "Insanity" Cube Puzzle
by Ieronim (Friar) on Jul 10, 2006 at 20:21 UTC
    I compared my new solution with your final and semi-final.

    Here's the benchmark's code:

    And here are the results:
    Rate L~R (semi) L~R (final) ieronim (new) L~R (semi) 15.5/s -- -94% -97% L~R (final) 258/s 1566% -- -48% ieronim (new) 500/s 3128% 94% --

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://559626]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found