SapphireSteel Forum
Welcome, Guest. Please login or register.
May 25, 2013, 09:47:28 AM

Login with username, password and session length
Search:     Advanced search
Welcome to the SapphireSteel forum - for discussion of the Ruby In Steel and Amethyst IDEs
3884 Posts in 800 Topics by 669 Members
Latest Member: m
* Home Help Search Login Register
+  SapphireSteel Forum
|-+  General
| |-+  Ruby In Steel
| | |-+  Ruby in Steel 2 VS 2010
« previous next »
Pages: [1] Print
Author Topic: Ruby in Steel 2 VS 2010  (Read 1771 times)
DDayanov
Newbie
*
Posts: 7


« on: December 21, 2011, 01:16:51 PM »

On my computer when I run ruby file without Debugging in VS 2010 with RubyInSteel 2 using Ruby 1.9.2 it takes 5 times longer then to run it in command line. Is it normal?
Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #1 on: December 21, 2011, 03:41:52 PM »

Doesn't sound right ... RiS just runs the file pretty much straight (in fact it does run it from a 'command' line), though it does redirect the IO through to the IDE. So if you have a lot of output, this will slow it down quite a bit.

Are you doing much I/O?

Dermot
Logged
DDayanov
Newbie
*
Posts: 7


« Reply #2 on: December 22, 2011, 07:58:29 AM »

Not input - some output and even if I minimize output it doesn't influence on speed - still 5 times slower.
« Last Edit: December 22, 2011, 08:01:00 AM by DDayanov » Logged
Dermot
Administrator
Hero Member
*****
Posts: 1005


« Reply #3 on: December 22, 2011, 03:33:47 PM »

I've just run a simple test ...

Code:
def fac(n)
if (n == 1) then return 1
else return fac(n-1)*n
end
end

def z(n)
while n > 0
fac(n)
n = n - 1
end
end

t1 = Time.new
(1..10).each do
z(1000)
end
t2 = Time.new
puts t2 - t1


puts "done"

If I run this from the IDE with no debugging, I get about 6 seconds - and about the same from the command line. If I run it with the debugger I get 14 seconds.

Can you try the same code with a crean project?

There is no difference between running Ruby from VS with no debugging and from a command line. VS runs Ruby from a command line anyway: it creates a process and runs cmd.exe which then runs Ruby.

Dermot

Dermot
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!