diff options
Diffstat (limited to 'railties/guides/source/performance_testing.textile')
-rw-r--r-- | railties/guides/source/performance_testing.textile | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile index 41bdd27e9b..32eebe863c 100644 --- a/railties/guides/source/performance_testing.textile +++ b/railties/guides/source/performance_testing.textile @@ -37,7 +37,7 @@ h4. Generating Performance Tests Rails provides a generator called +test_unit:performance+ for creating new performance tests: <shell> -rails generate test_unit:performance homepage +$ rails generate test_unit:performance homepage </shell> This generates +homepage_test.rb+ in the +test/performance+ directory: @@ -60,8 +60,8 @@ Let's assume your application has the following controller and model: <ruby> # routes.rb -map.root :controller => 'home' -map.resources :posts +root :to => 'home#index' +resources :posts # home_controller.rb class HomeController < ApplicationController @@ -316,16 +316,16 @@ Compile Ruby and apply this "GC Patch":http://rubyforge.org/tracker/download.php h5. Download and Extract <shell> -[lifo@null ~]$ mkdir rubygc -[lifo@null ~]$ wget <download the latest stable ruby from ftp://ftp.ruby-lang.org/pub/ruby> -[lifo@null ~]$ tar -xzvf <ruby-version.tar.gz> -[lifo@null ~]$ cd <ruby-version> +$ mkdir rubygc +$ wget <download the latest stable ruby from ftp://ftp.ruby-lang.org/pub/ruby> +$ tar -xzvf <ruby-version.tar.gz> +$ cd <ruby-version> </shell> h5. Apply the Patch <shell> -[lifo@null ruby-version]$ curl http://rubyforge.org/tracker/download.php/1814/7062/17676/3291/ruby186gc.patch | patch -p0 +$ curl http://rubyforge.org/tracker/download.php/1814/7062/17676/3291/ruby186gc.patch | patch -p0 </shell> h5. Configure and Install @@ -333,8 +333,8 @@ h5. Configure and Install The following will install ruby in your home directory's +/rubygc+ directory. Make sure to replace +<homedir>+ with a full patch to your actual home directory. <shell> -[lifo@null ruby-version]$ ./configure --prefix=/<homedir>/rubygc -[lifo@null ruby-version]$ make && make install +$ ./configure --prefix=/<homedir>/rubygc +$ make && make install </shell> h5. Prepare Aliases @@ -364,8 +364,8 @@ Additionally, install the following gems: If installing +mysql+ fails, you can try to install it manually: <shell> -[lifo@null mysql]$ gcruby extconf.rb --with-mysql-config -[lifo@null mysql]$ make && make install +$ gcruby extconf.rb --with-mysql-config +$ make && make install </shell> And you're ready to go. Don't forget to use +gcruby+ and +gcrake+ aliases when running the performance tests. @@ -398,7 +398,7 @@ $ rails benchmarker 'Item.first' 'Item.last' h4. +profiler+ -+profiler+ is a wrapper around http://ruby-prof.rubyforge.org/[ruby-prof] gem. ++profiler+ is a wrapper around the "ruby-prof":http://ruby-prof.rubyforge.org gem. Usage: @@ -436,7 +436,7 @@ h4. Model Project.benchmark("Creating project") do project = Project.create("name" => "stuff") project.create_manager("name" => "David") - project.milestones << Milestone.find(:all) + project.milestones << Milestone.all end </ruby> |