SapphireSteel Forum
Welcome, Guest. Please login or register.
June 20, 2013, 04:03:39 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Sapphire and Amethyst IDEs
3893 Posts in 803 Topics by 672 Members
Latest Member: davib
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Sapphire / Ruby In Steel
| | |-+  Debugger slowness
« previous next »
Pages: [1] Print
Author Topic: Debugger slowness  (Read 4741 times)
Slacker
Newbie
*
Posts: 5


« on: February 02, 2008, 10:08:47 AM »

I've just installed Ruby In Steel Text Edition (01.02.0376) on XP SP2, and used it to install Ruby/Rails/MySQL etc as I haven't done RoR dev on my PC before.

I've set up an existing RoR project in Ruby In Steel, and got it working with the debugger, etc.  Well, kind of.

Aside: I had to create a new project, and then copy my files over (and Synchronize), as when I try File|New|Project From Existing Code... I get this in a message box:

Quote
Class not registered
Looking for object with CLSID: {81A1ED1C-76B9-4363-A838-F413FCCBB606}

Anyway, my main issues are:

1. It takes ages for WEBrick to start when I start debugging my project (via F5) - about 70 seconds before it's loaded the code and started serving pages.
2. It takes ages for a page to be served - about 20-25 seconds.

If I just start the server manually using 'ruby script/server' it starts up in a few seconds, and the pages are served in about 1 second, as I would expect, so I assume my rails/db config is ok.

Possibly an important point is that my DB is postgres on another machine, but I noticed that pages took ages to be served even when the DB wasn't being accessed (I know this because I misconfigured postgres initially, so it was only when I tried to log in to my app that it hit the DB and failed.  The initial login page took ages to serve, even though it clearly wasn't accessing the DB).

On a simple 'empty' project created with the project dialog, even a simple 'Hello, world' template file still takes about 4 seconds to be served (i.e. I create an index method in my controller, and create index.rhtml with a simple line of text in it).

Is there any reason why it's so slow?  Is this why you call Cylon the 'fast' debugger?  Embarrassed

While I'm here, another question - when trying out the debugger, I added a simple method to my main controller to assign a couple of local variables, so try out the debugger. When I step over these lines, sometimes I end up back in server.rb (instead of moving to the next line) - is this a deficiency of the normal ruby debugger?
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #1 on: February 02, 2008, 10:30:42 AM »

The Text Edition goes at the speed of the default Ruby debugger. We don't do anything to slow it down. That's the speed the Ruby debugger always runs. Yes, Cylon is a lot faster. We've implemented Cylon from the ground up to run super-fast as you can see from our benchmarks:

http://www.sapphiresteel.com/Ruby-Debugger-Timings

We don't use the Visual Studio 'Convert Existing Code' option (though I'll see if we can provide a better error message  Wink ). To import existing projects into the Text Edition, you should use Project->Import and copy to a new location. We also have Convert in Place but this is only in the Developer Edition.

best wishes
Huw
Logged
Slacker
Newbie
*
Posts: 5


« Reply #2 on: February 02, 2008, 12:30:52 PM »

Thanks for responding - I'm relatively new to ruby, so I had only ever used the breakpointer style of debugging, which I guess means the code runs pretty much full speed until a call to 'breakpoint' is reached.

Ok, so this explains a lot - the standard ruby debugger is super-slow Embarrassed

Oh btw, thanks for the project Import info - I thought I'd read somewhere that the project import happened on the File menu, and my brain had managed to miss the Import Project type in the New Project dialog :-)

I'll probably end up getting the Dev version, just as soon as I can take a deep breath and pay for VS2008 - I assume you can't use Ruby In Steel dev version with something like VC# Express? i.e. a free version of VS2008.
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #3 on: February 02, 2008, 12:38:07 PM »

Yup, the standard Ruby debugger is slow. The Developer Edition can be installed into the version of Visual Studio which we supply with the Text Edition (you don't need to buy a full copy of VS). Just uninstall the Ruby In Steel Text Edition but leave everything else installed. Then download Ruby In Steel Developer for VS2008 and install that. You should be pleasantly surprised by the speed of the debugger...  Cheesy

best wishes
Huw
Logged
Slacker
Newbie
*
Posts: 5


« Reply #4 on: February 02, 2008, 01:02:24 PM »

Well, I did what you said and tried RiS Dev version, but the debugging was just as slow.

Then on a hunch I went into Project Properties and changed 'Using Cylon debugger' from False to True, and then it was a lot faster  Grin

Damn, looks like I'll have to buy this product now  Wink
Logged
Slacker
Newbie
*
Posts: 5


« Reply #5 on: February 02, 2008, 01:57:36 PM »

Ah, I do have a slight problem - although I can load my existing RiS projects fine, if I try to create a new Rails project, I get this error in a message box:

Quote
Project creation failed
Cannot find rails.cmd - have you installed Rails?

If I open a command prompt, and type 'rails -v', I get:  Rails 1.2.6

So rails seems to be installed.  I can't see anywhere I can configure this to try to fix it.

Any ideas how I can fix this?

To be clear: I uninstalled 'Ruby In Steel' from Add/Remove Windows Programs in Control Panel, and then downloaded RiS Dev edition (01.02.0375), and installed that.
Logged
Huw Collingbourne
Administrator
Hero Member
*****
Posts: 937



« Reply #6 on: February 02, 2008, 02:40:00 PM »

For some reason, the extension of the default Rails command file was changed (by the Rails developers) from .cmd to .bat. Our installer generally tries to locate whichever one is present but (I think?) we seem to have missed this time (probably due to the Text uninstall/Developer install process you just went through - I've entered this as a bug which we'll aim to fix in the next release). In the meantime, you should be able to fix this yourself by doing the following:

Find your main \ruby directory. this may be C:\ruby\bin or C:\Program Files\ruby\bin (for example). At any rate, you need the directory that contains ruby.exe. You should find that thuis also contains rails.bat. Select this file in the Windows Explorer and choose Copy, then Paste. Rename the copied file to rails.cmd.

That should solve the problem. If it doesn't or if you find that rails.cmd is already in the Ruby directory but is still not being found, please let us know.

best wishes
Huw
Logged
Slacker
Newbie
*
Posts: 5


« Reply #7 on: February 02, 2008, 05:36:18 PM »

Quote
Find your main \ruby directory. this may be C:\ruby\bin or C:\Program Files\ruby\bin (for example). At any rate, you need the directory that contains ruby.exe. You should find that thuis also contains rails.bat. Select this file in the Windows Explorer and choose Copy, then Paste. Rename the copied file to rails.cmd.

Yay, that fixed it - many thanks.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!