Slow ruby start up on XP

S

Steve Tuckner

This is a multi-part message in MIME format.

------=_NextPart_000_0C46_01C352BE.CDBCC430
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

On my Windows XP machine, if I run some command intensive operation
using the command prompt, (like a compile - or a ruby program -- see
below), then if I try to start another ruby program from another command
prompt, it will take forever to start (or a long long time). On my
system a 400Mhz system, It takes a 30 seconds for the first print (of
the second program) to come out and > 5 minutes to get past the require
of fox. Normally it takes about 4 seconds for the app to come up.

I am planning to use Ruby as a GUI application for a hardware device we
are going to sell and I am worried that the application might not start
up if someone is doing intensive work (or as in the case below not
really that intensive). Any one have any ideas on what I could do about
this problem? Also can any one try it on their Window's machine to see
how it runs or if you get similar results?

Anxious in Minnesota (Steve Tuckner)

P.S. For comparision I also ran a perl program that I wrote that uses TK
and it is hardly affected by the first running ruby program and I ran
Chandler the new super PIM written in python. It did seem to be
affected, but it still came up in 30 seconds instead of about 5 to 10.


--------- The first program is a simple counting program
---------------------------------

while true
starttime = Time.now
for i in 1..100000
j = i * 3
end
endtime = Time.now
print "time = #{endtime - starttime}\n"
end

---------- The second program is a fox program
----------------------------------------------

puts "before require fox"
require "fox"
puts "after require fox"

include Fox

class FxTestWindow < FXMainWindow
def initialize(app)
# Invoke base class initialize first
super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, 600, 600)
end

# Start
def create
super
show(PLACEMENT_SCREEN)
end
end

def runGUI
puts "before FXApp.new"
# Make an application
$application = FXApp.new("Dialog", "FxWorld")
puts "after FXApp.new"

# Open the display
$application.init(ARGV)

# Construct the application's main window
FxTestWindow.new($application)

# Create the application
$application.create

# Run the application
$application.run
end

puts "before runGUI"
runGUI

Steve Tuckner



------=_NextPart_000_0C46_01C352BE.CDBCC430
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>



<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D121370819-25072003>On my =
Windows XP=20
machine, if I run some command intensive operation using the command =
prompt,=20
(like a compile - or a ruby program -- see below), then if I try to =
start=20
another ruby program from another command prompt, it will take forever =
to start=20
(or a long long time).&nbsp; On my system a 400Mhz system, It takes a =
30 seconds=20
for the first print (of the second program) to come out and &gt; 5 =
minutes to=20
get past the require of fox. Normally it takes about 4 seconds for the =
app to=20
come up. </SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D121370819-25072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D121370819-25072003>I am =
planning to use=20
Ruby as a GUI&nbsp;application for a hardware device we are going to =
sell and I=20
am worried that the application might not start up if someone is doing =
intensive=20
work (or as in the case below not really that intensive). Any one have =
any ideas=20
on what I could do about this problem? Also can any one try it on their =
Window's=20
machine to see how it runs or if you get similar =
results?</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D121370819-25072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D121370819-25072003>Anxious in Minnesota=20
(</SPAN></FONT><FONT><SPAN class=3D121370819-25072003><FONT =
face=3DArial=20
size=3D2>Steve Tuckner)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV></SPAN></FONT><SPAN class=3D121370819-25072003><FONT face=3DArial =
size=3D2>P.S.=20
For comparision I also ran a perl program that I wrote that uses TK and =
it is=20
hardly affected by the first running ruby program and I ran Chandler =
the new=20
super PIM written in python. It did seem to be affected, but it still =
came up in=20
30 seconds instead of about 5 to 10.</FONT></SPAN></DIV>
<DIV><SPAN class=3D121370819-25072003><FONT face=3DArial=20
size=3D2></FONT></SPAN>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D121370819-25072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN =
class=3D121370819-25072003>--------- The first=20
program is a simple counting program=20
---------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN=20
class=3D121370819-25072003></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>while true<BR>&nbsp; starttime =3D =
Time.now<BR>&nbsp;=20
for i in 1..100000<BR>&nbsp;&nbsp; j =3D i * 3<BR>&nbsp; end<BR>&nbsp; =
endtime =3D=20
Time.now<BR>&nbsp; print "time =3D #{endtime - =
starttime}\n"<BR>end</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><SPAN class=3D121370819-25072003><FONT face=3DArial =
size=3D2>---------- The=20
second program is a fox program=20
----------------------------------------------</FONT></SPAN></DIV>
<DIV><FONT><SPAN class=3D121370819-25072003><BR><FONT face=3DArial =
size=3D2>puts=20
"before require fox"<BR>require "fox"<BR>puts "after require =
fox"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>include Fox</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>class FxTestWindow &lt; =
FXMainWindow<BR>&nbsp;def=20
initialize(app)&nbsp;<BR>&nbsp;&nbsp;# Invoke base class initialize=20
first<BR>&nbsp;&nbsp;super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, =
600,=20
600)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;end</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;# Start<BR>&nbsp;def=20
create<BR>&nbsp;&nbsp;super<BR>&nbsp;&nbsp;show(PLACEMENT_SCREEN)<BR>&nb=
sp;end<BR>end</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>def runGUI<BR>puts "before =
FXApp.new"<BR>&nbsp;#=20
Make an application<BR>&nbsp;$application =3D FXApp.new("Dialog",=20
"FxWorld")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>puts "<SPAN =
class=3D121370819-25072003>after=20
</SPAN>FXApp.new"<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;# Open the=20
display<BR>&nbsp;$application.init(ARGV)<BR>&nbsp;<BR>&nbsp;# Construct =
the=20
application's main =
window<BR>&nbsp;FxTestWindow.new($application)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;# Create the=20
application<BR>&nbsp;$application.create</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;# Run the=20
application<BR>&nbsp;$application.run<BR>end</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>puts "before=20
runGUI"<BR>runGUI</FONT></SPAN></FONT></DIV>
<P><FONT face=3DArial size=3D2>Steve Tuckner</FONT> =
<BR></P></BODY></HTML>

------=_NextPart_000_0C46_01C352BE.CDBCC430--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top