1

Topic: Speeding up rails environment loading

Hi there,

I am running a rails website, where users can trigger several ruby scripts. Each of which loads the rails environment and does stuff. However, loading the rails environment is very slow (several seconds for each script). Is there a way to speed things up? Of course, I could put all my scripts in one file, so that only one rails environment gets loaded, but I dont want to do that. I could also use ActiveRecord and not Rails, which would suffice for my purposes, but would also blow up the code...

Is there any nice and easy way to speed up the process of loading the rails environment in external scripts?

Thanks, Flo

Re: Speeding up rails environment loading

I'm having a similar issue. After upgrading to rails 2.3.4 and ruby 1.8.7 it takes a very long time (>5 seconds) for my rails app to load classes. It runs very fast in production mode after the classes have been cached. I have tried this on both passenger and mongrel. Any ideas?

Re: Speeding up rails environment loading

I figured out the cause of my performance issue. It had nothing to do with Rails but was due to a switch in database configuration.

4

Re: Speeding up rails environment loading

I found a solution to my problem.. I just load boot.rb, active record and some psql magic from new_rails_defaults.rb.. Its about 5 times faster as environment.rb