From: Steve Tuckner Date: 2003-07-26T05:10:05+09:00 Subject: Slow ruby start up on XP 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
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).  On my system a 400Mhz system, It takes a = 30 seconds=20 for the first print (of the second program) to come out and > 5 = minutes to=20 get past the require of fox. Normally it takes about 4 seconds for the = app to=20 come up.
 
I am = planning to use=20 Ruby as a GUI 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?
 
Anxious in Minnesota=20 (Steve Tuckner)
 
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.
 
 
--------- The first=20 program is a simple counting program=20 ---------------------------------
 
while true
  starttime =3D = Time.now
 =20 for i in 1..100000
   j =3D i * 3
  end
  = endtime =3D=20 Time.now
  print "time =3D #{endtime - = starttime}\n"
end
 
---------- The=20 second program is a fox program=20 ----------------------------------------------

puts=20 "before require fox"
require "fox"
puts "after require = fox"
 
include Fox
 
class FxTestWindow < = FXMainWindow
 def=20 initialize(app) 
  # Invoke base class initialize=20 first
  super(app, "FxTest", nil, nil, DECOR_ALL, 0, 0, = 600,=20 600)
 end
 
 # Start
 def=20 create
  super
  show(PLACEMENT_SCREEN)
&nb= sp;end
end
 
def runGUI
puts "before = FXApp.new"
 #=20 Make an application
 $application =3D FXApp.new("Dialog",=20 "FxWorld")
puts "after=20 FXApp.new"
 # Open the=20 display
 $application.init(ARGV)
 
 # Construct = the=20 application's main = window
 FxTestWindow.new($application)
 
 # Create the=20 application
 $application.create
 
 # Run the=20 application
 $application.run
end
 
puts "before=20 runGUI"
runGUI

Steve Tuckner =

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