
Rails 3.2 RC1: Faster dev mode & routing, explain queries, tagged logger, store - aaronbrethorst
http://weblog.rubyonrails.org/2011/12/20/rails-3-2-rc1-faster-dev-mode-routing-explain-queries-tagged-logger-store
======
Corrado
I've really noticed quite a bit of speed improvement lately with Ruby 1.9.3
and now Rails 3.2.0-rc1, at least in my development environment. It's a good
thing too because lately I have been thinking back fondly of the good old
Rails 2.x days when you could restart the development environment without
flinching. With the latest incarnation of these two tools I love the Rake
command again. :)

Now, if we could just get someone to commit the fix for the debugger under
Ruby 1.9.3. Not being able to debug, or at least having to work too hard at
it, is really a drag on my productivity and is keeping me from moving to the
newer faster stuff everywhere. Come on Mr. Moseley, release ruby-debug-base19
v0.11.26 already!

~~~
sandGorgon
does this fix the abominably slow development with the asset pipeline (without
the gems needed to hack it and speed it up)?

Basically, can someone give me a way back into pre-3.1 asset pipeline slowdown
?

~~~
tmeasday
Can you be more specific? Are you talking about rails startup time or SASS
compilation? Or something else?

~~~
sandGorgon
in dev mode, the asset pipeline induces extremely slow page loads in
development (2-4 seconds per page locally)

This has been the single biggest complaint against Rails 3.1 if you google for
it. For e.g. take a look at [http://stackoverflow.com/questions/8084006/serve-
assets-dire...](http://stackoverflow.com/questions/8084006/serve-assets-
directly-no-asset-pipeline-in-development)

Similar questions have been addressed by either installing rails-dev-tweaks or
by pre-compiling assets - which is then a problem if you're actually working
on the UI/JS - which is where half the dev time is usually spent.

~~~
ruckusing
I've noticed that using Passenger Standalone is faster than webrick / mongrel
in dev mode using Asset Pipeline. Give it a shot.

~~~
jaylevitt
I just switched to pow to avoid the annoying content-length warnings in 1.9.3
webrick, and it's pretty darn zippy, debug-mode asset pipeline and all:

curl get.pow.cx | VERSION=0.4.0-pre sh

------
burke
Not mentioned anywhere is that the PostgreSQL adapter now supports using the
Schema Search Path without fistfuls of bugs and oversights.

I'm using schema separation for a multitenant application, and it looks like
I'll be able to remove at least 4/6 hacks to make rails support that
functionality.

~~~
marcalc
Also, if it is not much to ask, I know this is not the topic, but could you
describe how you make this kind of separation? I have the same requirements
for isolation and your experience in the matter would be valuable. :)

~~~
sant0sk1
Awhile back, I blogged how to go about this. Some of the hacks will not be
needed for Rails 3.2, but the concepts are the same:

[http://blog.jerodsanto.net/2011/07/building-multi-tenant-
rai...](http://blog.jerodsanto.net/2011/07/building-multi-tenant-rails-apps-
with-postgresql-schemas/)

~~~
marcalc
I remember reading your post some time ago, it really helped me creating a
better view of this solution and is in fact our preferred method thanks to it.
I still haven't implemented it for real and it would be great, if not much to
ask you, if you could elaborate the impact of these changes in a post update?
What do you think?

------
jacques_chester
Good to see that rails developers are progressively seeing the database as a
powerful tool and not just as flat files with funny accents.

------
jarin
Uh oh, I haven't even updated my clients to Rails 3.1 yet. Definitely not good
to fall behind more than a major point release or two with Rails. I have a
very old client running Rails 2.3.x and it's always a pain when they need the
occasional update and Rake doesn't even work anymore.

~~~
ddagradi
It sounds like you're not using rvm and gemsets (or a similar tool) for your
Rails 2.3.x sites. Rake should never "stop working".

<http://beginrescueend.com/>

~~~
mechazoidal
Unless you're on a platform where you can't get gcc >4.0, so RVM is helpless,
and you're stuck with just bundler. Then the rake/cron nightmares come..

------
burke
In my project, "rake environment" took 11.5 seconds on rails 3.1.x, and 8.7
seconds on rails 3.2. (1.9.3.p0 for both).

I'm quite happy about this, as the initial development boot time is what's
been bothering me most lately.

~~~
jhealy
We see ~20% improvement with the same upgrade (on 1.9.3p0).

8.5s to 6.6s on my laptop (with SSD). Nice!

~~~
wfarr
Seeing about 25% speedup here with just the Rails 3.2 RC1.

Combined with rspec-rails 2.8.0.rc2 (which includes some Rails 3.2-related
changes), I saw my test suite go from ~2.5s (Rails 3.2.0.rc1 w/ rspec 2.7.x)
to ~0.43s (Rails 3.2.0.rc1 w/ rspec 2.8.0.rc2).

Ruby 1.9.3p0 across the board.

~~~
samg_
Just upgrading to rspec 2.8 made my test suite run 10x faster. You might have
David to thank for a lot of that speed up. :)

~~~
wfarr
Certainly a LOT of it is rspec 2.8.

But there was a definite increase with Rails 2.3 as well. :)

~~~
nirvdrum
I agree. 2.3 was much faster :-)

------
keeran
Nice tech talk about the thinking behind the new router from Aaron Patterson
(@tenderlove) at MagRails.

<http://www.youtube.com/watch?v=sEbobUPqhL4>

~~~
cliftonk
<https://github.com/rails/journey> is the code for his router

Great talk, also.

------
kposehn
Key/Value storage built in?

I love rails :)

