why is my program taking so long?

F

finer recliner

i just wrote a program in ruby that generates sudoku puzzles. its
fairly long (~600 lines) so i wont post it all here.

from what i've read from other programmers (who may have coded their
sudoku generators in C++ or java or something else) they're programs
are able to generate much faster than mine, claiming they can generate
hundreds of puzzles per second. mine can generate ONE puzzle in ~700
ms :(

so my question is, how can i use the ruby debugger to find out where
my application is spending most of its time, so i can try to optimize
it some more.


thanks in advance for the help.
 
P

Phrogz

so my question is, how can i use the ruby debugger to find out where
my application is spending most of its time, so i can try to optimize
it some more.

thanks in advance for the help.

If you require the profiler library at the top of your code (or one of
the faster, newer profiling libraries available) you can get a very
nice listing of all method calls, call counts, and execution time for
each.

A wee bit of Googling should give you all the details you need.
 
S

shendoku.de

If you want to try out something new in sudoku, try shendoku, using
the sudoku rules but playing two people, one against the other, like
battleshipps. They have a free version to download at http://www.shendoku.com/sample.pdf
.. Anything else they are bringing out or they are working on you can
find at www.shendoku.com or at they´r blog www.shendoku.blogspot.com .
Have fun, I am. I specially like one slogan I heard about Shendoku:
SUDOKU is like masturbation (one person).... SHENDOKU is like sex (it
takes two).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,311
Members
47,983
Latest member
Derek9890

Latest Threads

Top