[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Rails Scripts Slow?

HBTaylor

4/10/2005 1:12:00 AM

I have just started looking at Ruby and Ruby on Rails, and have run
into a question. It may very well be something in an FAQ or something,
but I haven't had luck framing the right query to find it. Thanks for
any help out there.

I have been following Curt Hibbs' tutorial from ONLamp, and the Rails
scripts seem to be VERY slow to execute. For example, just running
"ruby script/generate" to get the usage information takes more than 30
seconds. If I run "ruby -v script\generate", I see a whole slew of
messages go by, and there are pauses after various messages (i.e.,
"method redefined" and "ambiguous first argument"). I can include the
verbose messages if needed, but don't want to take up space if it is
something I should have found otherwise.

Some details:

OS : Windows XP SP2
Processor: 2.8GHz Celeron
Ruby version : 1.8.2
Rails: Installed via gem (on April 8, 2005)

Running "ruby -v" returns a value almost instaneously.
Running a trivial "Hello World" application executes almost
instaneously.

I don't know if there is something weird with my configuration, or if
there is some way to cache the information so it isn't reloaded each
time, but it seems like those scripts should execute more quickly. Am I
off base, or is that amount of time usual for those generate, etc.,
scripts?

Performance of the Rails application itself seems to be okay (I'm
running through WEBrick at the moment) but not blindingly fast.

Thanks again for any help.

H.B.

15 Answers

Curt Hibbs

4/10/2005 1:46:00 AM

0

HBTaylor wrote:
> I have just started looking at Ruby and Ruby on Rails, and have run
> into a question. It may very well be something in an FAQ or something,
> but I haven't had luck framing the right query to find it. Thanks for
> any help out there.
>
> I have been following Curt Hibbs' tutorial from ONLamp, and the Rails
> scripts seem to be VERY slow to execute. For example, just running
> "ruby script/generate" to get the usage information takes more than 30
> seconds. If I run "ruby -v script\generate", I see a whole slew of
> messages go by, and there are pauses after various messages (i.e.,
> "method redefined" and "ambiguous first argument"). I can include the
> verbose messages if needed, but don't want to take up space if it is
> something I should have found otherwise.
>
> Some details:
>
> OS : Windows XP SP2
> Processor: 2.8GHz Celeron
> Ruby version : 1.8.2
> Rails: Installed via gem (on April 8, 2005)
>
> Running "ruby -v" returns a value almost instaneously.
> Running a trivial "Hello World" application executes almost
> instaneously.
>
> I don't know if there is something weird with my configuration, or if
> there is some way to cache the information so it isn't reloaded each
> time, but it seems like those scripts should execute more quickly. Am I
> off base, or is that amount of time usual for those generate, etc.,
> scripts?
>
> Performance of the Rails application itself seems to be okay (I'm
> running through WEBrick at the moment) but not blindingly fast.
>
> Thanks again for any help.

I'm sorry I can't be much help, but its definitely something wrong with
your system. Running a "ruby script\generate" for me takes only a few
seconds on my WinXP SP2 that is a 1.5GHz AMD Athlon.

Curt


HBTaylor

4/10/2005 3:23:00 PM

0

Curt,

Thanks at least for confirming that it SHOULDN'T be the case. I still
can't figure out why it is doing that. I'll try on another couple of
machines and see if I can infer any causes from differences among the
machines.

H.B.

Douglas Livingstone

4/10/2005 10:08:00 PM

0

On Apr 10, 2005 2:19 AM, HBTaylor <hbtaylor@gmail.com> wrote:
> For example, just running
> "ruby script/generate" to get the usage information takes more than 30
> seconds.

And I was thinking that my computer's 2 second start time for any
loacl ruby script was slow!


Steve V

4/11/2005 5:46:00 PM

0


> Thanks at least for confirming that it SHOULDN'T be the case. I still
> can't figure out why it is doing that. I'll try on another couple of
> machines and see if I can infer any causes from differences among the
> machines.

Any luck determining the cause of this? I experience the same problem when
generating Rails code. I'm on W2K, with an Athlon 2200XP. It takes about 17
seconds on average which seems absolutely absurd considering what exactly it
is generating.

Steve




Joe Van Dyk

4/11/2005 6:36:00 PM

0

Can you profile it? (might be able to pass -r profile ?)

On Apr 11, 2005 10:46 AM, Steve V <ruby@digitalnothing.com> wrote:
>
> > Thanks at least for confirming that it SHOULDN'T be the case. I still
> > can't figure out why it is doing that. I'll try on another couple of
> > machines and see if I can infer any causes from differences among the
> > machines.
>
> Any luck determining the cause of this? I experience the same problem when
> generating Rails code. I'm on W2K, with an Athlon 2200XP. It takes about 17
> seconds on average which seems absolutely absurd considering what exactly it
> is generating.
>
> Steve
>
>


Steve V

4/12/2005 2:25:00 AM

0

>
> Can you profile it? (might be able to pass -r profile ?)

Apologies to the group if multiple versions of this message came through.
I'm assuming I exceeded some maximum byte threshold when attaching the whole
profiling.

The profile is attached. The offender appears to be #toplevel(which only
appears once in the whole profile). To possibly save some time I have pasted
below the #toplevel line, as well as surrounding lines.

0.00 22.12 0.00 4 0.00 0.00
SOAP::SOAPExternalReference#method_added
0.00 22.12 0.00 1 0.00 0.00
ActiveRecord::Base#configurations
0.00 22.12 0.00 3 0.00 0.00
XSD::XSDByte#method_added
0.00 22.12 0.00 3 0.00 0.00
ERB::Compiler#initialize
0.00 22.12 0.00 1 0.00 0.00
#<Class:0x3c97558>#initialize
0.00 22.12 0.00 14 0.00 0.00 File#exists?
0.00 22.12 0.00 1 0.00 0.00 Float#**
0.00 22.12 0.00 48 0.00 7.48 OptionParser#search
0.00 22.12 0.00 2 0.00 8.00
Class#class_inheritable_accessor
0.00 22.12 0.00 1 0.00 22094.00 #toplevel
0.00 22.12 0.00 2 0.00 0.00
Gem.ensure_gem_subdirectories
0.00 22.12 0.00 7 0.00 0.00 IO#close
0.00 22.12 0.00 2 0.00 0.00
Rails::Generator::Spec#class_name
0.00 22.12 0.00 1 0.00 0.00 Kernel.untaint
0.00 22.12 0.00 1 0.00 0.00 String#rstrip
0.00 22.12 0.00 1 0.00 672.00
Rails::Generator::Manifest#replay
0.00 22.12 0.00 1 0.00 0.00
SOAP::Mapping::TypedArrayFactory_#initialize
0.00 22.12 0.00 1 0.00 0.00 Kernel.method_added
0.00 22.12 0.00 3 0.00 0.00
SOAP::Mapping::DateTimeFactory_#method_added
0.00 22.12 0.00 9 0.00 0.00
SOAP::Mapping::Factory#method_added
0.00 22.12 0.00 4 0.00 0.00 OptionParser#separator

So I guess the question is... What the heck does #toplevel do? In my case,
what is it doing that it's not supposed to?

Thanks,
Steve




rst0wxyz

11/13/2010 12:19:00 AM

0

On Nov 12, 4:05 pm, Bert Hyman <b...@iphouse.com> wrote:
> Innews:5633cbe0-7039-4b18-bce8-2f840974b32a@o11g2000prf.googlegroups.com
>
> rst0wxyz <rst0w...@yahoo.com> wrote:
> > There are violence against women all over the world, not only in the
> > U.S.
>
> The OP is from Saudi Arabia, where violence against women is required by
> law.

No country or nation has laws where "violence against women is
required by
law". Laws and moral standards are established for each and all
societies. When it is broken, a penalty is applied. Of course in
today's society, many in power took advantage of their position of
power and misused of power is often the case.

Bert Hyman

11/13/2010 12:23:00 AM

0

In news:74511441-3a4f-4a5e-906f-8d2f76d181e5@x7g2000prj.googlegroups.com
rst0wxyz <rst0wxyz@yahoo.com> wrote:

> On Nov 12, 4:05 pm, Bert Hyman <b...@iphouse.com> wrote:
>> Innews:5633cbe0-7039-4b18-bce8-2f840974b32a@o11g2000prf.googlegroups.c
>> om
>>
>> rst0wxyz <rst0w...@yahoo.com> wrote:
>> > There are violence against women all over the world, not only in
>> > the U.S.
>>
>> The OP is from Saudi Arabia, where violence against women is required
>> by law.
>
> No country or nation has laws where "violence against women is
> required by
> law".

That's not at all true.

> Laws and moral standards are established for each and all
> societies.

And some of them establish so-called "standards" which are abhorent to
westerners.

> When it is broken, a penalty is applied.

Like stoning? Or having limbs cut off?

--
Bert Hyman St. Paul, MN bert@iphouse.com

soc.culture.china

11/13/2010 3:13:00 AM

0

On Nov 12, 4:23 pm, Bert Hyman <b...@iphouse.com> wrote:
> Innews:74511441-3a4f-4a5e-906f-8d2f76d181e5@x7g2000prj.googlegroups.com
>
> rst0wxyz <rst0w...@yahoo.com> wrote:
> > On Nov 12, 4:05 pm, Bert Hyman <b...@iphouse.com> wrote:
> >> Innews:5633cbe0-7039-4b18-bce8-2f840974b32a@o11g2000prf.googlegroups.c
> >> om
>
> >> rst0wxyz <rst0w...@yahoo.com> wrote:
> >> > There are violence against women all over the world, not only in
> >> > the U.S.
>
> >> The OP is from Saudi Arabia, where violence against women is required
> >> by law.
>
> > No country or nation has laws where "violence against women is
> > required by
> > law".
>
> That's not at all true.

Yes, it's true.

>
> > Laws and moral standards are established for each and all
> > societies.
>
> And some of them establish so-called "standards" which are abhorent to
> westerners.

Abd some Western laws or standards are abhorent to them.

>
> > When it is broken, a penalty is applied.
>
> Like stoning? Or having limbs cut off?

Or fly prisoners secretly to foreign countries to be tortured, and
some were streep naked and left on the cold stone floor to die.

>
> --
> Bert Hyman St. Paul, MN b...@iphouse.com

Nusrat, Rowayton, Connecticut

11/13/2010 8:12:00 AM

0

On Fri, 12 Nov 2010 19:12:32 -0800 (PST), "soc.culture.china"
<bcd00fgh@yahoo.com> wrote:

>On Nov 12, 4:23 pm, Bert Hyman <b...@iphouse.com> wrote:
>> Innews:74511441-3a4f-4a5e-906f-8d2f76d181e5@x7g2000prj.googlegroups.com
>>
>> rst0wxyz <rst0w...@yahoo.com> wrote:
>> > On Nov 12, 4:05 pm, Bert Hyman <b...@iphouse.com> wrote:
>> >> Innews:5633cbe0-7039-4b18-bce8-2f840974b32a@o11g2000prf.googlegroups.c
>> >> om
>>
>> >> rst0wxyz <rst0w...@yahoo.com> wrote:
>> >> > There are violence against women all over the world, not only in
>> >> > the U.S.
>>
>> >> The OP is from Saudi Arabia, where violence against women is required
>> >> by law.
>>
>> > No country or nation has laws where "violence against women is
>> > required by
>> > law".
>>
>> That's not at all true.

Koran or child molester ranting is full of statements that are nothing
but rank misogyny.


>Yes, it's true.
>
>>
>> > Laws and moral standards are established for each and all
>> > societies.
>>
>> And some of them establish so-called "standards" which are abhorent to
>> westerners.
>
>Abd some Western laws or standards are abhorent to them.

Like which laws and abhorent to whom?

>>
>> > When it is broken, a penalty is applied.
>>
>> Like stoning? Or having limbs cut off?
>
>Or fly prisoners secretly to foreign countries to be tortured, and
>some were streep naked and left on the cold stone floor to die.

Did you ever think why the terrorists are flown to other countries. If
you know the reason than you would not be so quick to condemn
the Western world.