[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

why is my program taking so long?

finerrecliner

7/8/2007 8:42:00 PM

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.

1 Answer

Phrogz

7/9/2007 4:05:00 AM

0

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.