rails is awesome

N

Nicholas Van Weerdenburg

What would the relationship be between Struts (servlet-based) and FCGI
(cgi container)?

Also, Struts is actually pretty lightweight- it doesn't really do that
much. I'd expect you had another issue?

Cheers,
Nick
 
N

Nicholas Van Weerdenburg

I just installed the beta on my Mac OS X G4 450MHz box, and I'm ecstatic.

My page loads during development went from 8-10 seconds to mostly < 1
seconds.

Singe page loads, rough estimates:
0.8.5 rails Webrick, no caching: 8-10 seconds
0.8.5 rails Webrick, -c (not usable for development before): 4-5 seconds
Beta rails, webbrick, -c (caching): < 1 second

Cool. Now I can use my Mac for rails development!

Thanks,
Nick
 
D

Dick Davies

* Nicholas Van Weerdenburg said:
What would the relationship be between Struts (servlet-based) and FCGI
(cgi container)?

Also, Struts is actually pretty lightweight- it doesn't really do that
much. I'd expect you had another issue?

Well, I'll leave aside the lightweightness of Struts, I never got into it
enough to know better - it was a 12Mb download last time I looked though.

I'm really talking about performance in development on rails and
tomcat, the bottleneck in question with struts development is jsp
compilation as far as I can make out. I always quite liked the servlet API,
but JSPs (which is where struts focusses, that and custom taglibs).

The jsp two-step compile has always been a bit of a kludge IMO,
I always wonder whose idea that was....

(I know technically you could use something else for the view, but this is
'hello world' we're talking about now....)


But it's the same fundamental problem, how often you poll for code changes.
I remember Ara or Carl (on that rubygarden fastcgi page) had a trick that
let your fastcgi classes detect when their *.rb file had changed and reload
themselves, I'm assuming that might have benn involved here.
 
D

David Heinemeier Hansson

But it's the same fundamental problem, how often you poll for code
changes.
I remember Ara or Carl (on that rubygarden fastcgi page) had a trick
that
let your fastcgi classes detect when their *.rb file had changed and
reload
themselves, I'm assuming that might have benn involved here.

That would be auto-reload.rb. I'm not using that here as it had a bunch
of other issues. And frankly, I could get away with way Less Software.
All the framework code and infrastructure is loaded using require,
which is then cached for the remainder of the interpreters life cycle.

But all the application code is using "load", which means that it'll
reevaluate everything on each request. This turns out to be pretty
cheap even for "big" applications like Basecamp. It was much more
expensive to parse the Rails framework AND create a new Ruby process.

There are a few drawbacks to this approach, but all something that can
be learnt to live with:

1) Load is just reopening existing classes and overwriting behavior.
This doesn't work for removing methods. You'll still have to restart
the server there. Luckily, the times where it makes a difference
whether a method was actually removed (instead of just not used) are
few and far in between.

2) Your model class definitions have to be idempotent (it doesn't
matter for controllers since they're defined in an anonymous module for
other reasons). Passing the class definition twice must not have
side-effects. Currently, I lack to deal with one case in Active Record
where this is not the case (using the macro-based callbacks).
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain
 
D

Dick Davies

* David Heinemeier Hansson said:
That would be auto-reload.rb.

Sorry, by mistake - I meant for fastcgi not modruby, should have typed
'detect when their *.fcgi file had changed', see:

http://www.rubygarden.org/ruby?FCGIRubyWhyArentMyChangesDisplayed
1) This doesn't work for removing methods.
2) Your model class definitions have to be idempotent

That's a small price to pay, so long as the docs mention to restart
the webserver if things look screwy.

Thanks for the headsup.
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top