Forum: Ruby why is my program taking so long?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
4c1a984ce5500768c3ef3ade9ade033c?d=identicon&s=25 finer recliner (Guest)
on 2007-07-11 15:22
(Received via mailing list)
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.
852a62a28f1de229dc861ce903b07a60?d=identicon&s=25 Phrogz (Guest)
on 2007-07-11 15:25
(Received via mailing list)
On Jul 8, 2:42 pm, finer recliner <finerrecli...@gmail.com> wrote:
> 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.
6b91ddebb960442d0790a7bb07ae29e7?d=identicon&s=25 shendoku.de@gmail.com (Guest)
on 2007-07-11 15:43
(Received via mailing list)
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).
B9b5ff40232c1dfd61238c2a90467f84?d=identicon&s=25 Wayne E. Seguin (Guest)
on 2007-07-12 03:00
(Received via mailing list)
On Jul 11, 2007, at 09:17 , finer recliner wrote:
> <snip>
> 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.

http://ruby-prof.rubyforge.org/
This topic is locked and can not be replied to.