From: Matthew Desmarais Date: 2006-04-13T01:53:13+09:00 Subject: Re: First script seems slow - What's a better way to write t Charlotte wrote: > Thanks for the link. However, I forgot to mention that the reason I'm > doing this myself is because no currently available tools like that work > with my code, as it contains commands specific to the program it extends > and gives errors telling me that they are invalid command names. > > Basically, I'm just trying to figure out if it's my fault the script is > slow, or if Ruby just isn't very efficient. > > >> I realise that this does nothing for your Ruby but perhaps it will help >> you get onto something more interesting :) >> > > This is more interesting ;) > > On a side note, so far I like Ruby better than tcl. > Hi there, I'm afraid that I can't take the time right now to really pore over the script you've posted, but it doesn't look unreasonable to me. Of course, I'm not terribly clever so take that with a grain of salt. ;-) It's true that blistering speed is not listed as one of the current Ruby interpreter's features and you may be seeing an example of that. You can probably get a better view of the situation by running your script with the profiling library enabled. Try running it like this: ruby -rprofile ProcList.rb inputfilepath outputfilename It will take even longer, but you'll end up with a report showing you where in your script you are spending the most time. Maybe it will reveal a few hot spots that you can speed up a bit. Good luck, and don't hesitate to continue posting problems here. There are a lot of awfully smart people on this list that are often willing to help out in situations like yours. Regards, Matthew Desmarais