{"id":165627,"date":"2013-01-13T11:44:04","date_gmt":"2013-01-13T07:44:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=165627"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=165627","title":{"rendered":"<span class=\"post_title\">\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a Ruby on Rails \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0442\u0447\u0435\u0439 RVM railsexpress<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0435\u043b\u044c\u0441\u043e\u0432, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 ruby.<br \/>  \u041e \u0442\u043e\u043c \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c RVM (Ruby version manager) \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.<br \/>  \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0442\u0447\u0435\u0439 \u0432 RailsExpress \u0434\u043b\u044f Ruby 1.9.3-p362 <br \/>  (\u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0440\u0443\u0431\u0438 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438)  <\/p>\n<pre><code class=\"bash\">Applying patch railsexpress\/01-fix-make-clean.patch Applying patch railsexpress\/02-railsbench-gc.patch Applying patch railsexpress\/03-display-more-detailed-stack-trace.patch Applying patch railsexpress\/04-fork-support-for-gc-logging.patch Applying patch railsexpress\/05-track-live-dataset-size.patch Applying patch railsexpress\/06-webrick_204_304_keep_alive_fix.patch Applying patch railsexpress\/07-export-a-few-more-symbols-for-ruby-prof.patch Applying patch railsexpress\/08-thread-variables.patch Applying patch railsexpress\/09-faster-loading.patch Applying patch railsexpress\/10-falcon-st-opt.patch Applying patch railsexpress\/11-falcon-sparse-array.patch Applying patch railsexpress\/12-falcon-array-queue.patch <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h5>1. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c RVM \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043d\u0430\u0434\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0442\u044c Ruby<\/h5>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b .rvmrc \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435.  <\/p>\n<pre><code class=\"bash\">$ nano -e $HOME\/.rvmrc <\/code><\/pre>\n<p>  \u0418 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c RVM \u0441 \u043a\u0430\u043a\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c Ruby.  <\/p>\n<pre><code class=\"bash\">CFLAGS=&quot;-march=native -O2 -pipe -fomit-frame-pointer&quot; rvm_configure_env=(CFLAGS=&quot;-march=native -O2 -pipe -fomit-frame-pointer&quot;) <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <i>-march=native<\/i> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0443 \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0432\u044b\u0431\u043e\u0440 \u0442\u0438\u043f\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0445 \u044d\u0442\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. \u0415\u0441\u043b\u0438 \u0432\u044b \u0442\u043e\u0447\u043d\u043e \u0437\u043d\u0430\u0435\u0442\u0435 \u0442\u0438\u043f \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <i>-march=prescott<\/i><\/p>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f: [ctrl + X], \u043f\u043e\u0442\u043e\u043c [Y] \u2014 \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0439\u0442\u0438 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 nano.<\/p>\n<h5>2. \u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 Ruby \u0432 RVM<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">$ rvm get head <\/code><\/pre>\n<h5>3. \u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \/ \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c ruby \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0447\u0435\u0439 railsexpress<\/h5>\n<p>  \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 Ruby 1.9.3-p362  <\/p>\n<pre><code class=\"bash\">$ rvm reinstall 1.9.3-p362 --patch railsexpress -n railsexpress -j 3 $ rvm list $ rvm use ruby-1.9.3-p362-railsexpress --default <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0432\u0435\u0440\u0441\u0438\u044e, \u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e <i>p362<\/i> \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <i>head<\/i>,<br \/>  \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u0442\u0447\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0437\u0430\u043f\u0430\u0437\u0434\u0430\u043d\u0438\u0435\u043c, \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0438\u043c\u0435\u0442\u044c \u0432\u0432\u0438\u0434\u0443.<\/p>\n<h5>4. \u0411\u043e\u043d\u0443\u0441<\/h5>\n<p>  <\/p>\n<pre><code class=\"bash\">export RUBY_HEAP_MIN_SLOTS=1000000 export RUBY_HEAP_FREE_MIN=500000 export RUBY_HEAP_SLOTS_INCREMENT=1000000 export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 export RUBY_GC_MALLOC_LIMIT=100000000 <\/code><\/pre>\n<h5>5. \u041c\u0435\u0440\u044f\u0435\u043c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c<\/h5>\n<p>  \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0440\u0435\u043b\u044c\u0441 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u0440\u0438\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"bash\">$ time bundle exec rake routes <\/code><\/pre>\n<p>  \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<br \/>  \u0434\u043e<br \/>  <code> real  0m42.547s user 0m36.502s sys   0m2.248s <\/code><br \/>  \u043f\u043e\u0441\u043b\u0435<br \/>  <code> real  0m17.200s user 0m15.089s sys   0m1.072s <\/code><\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0438\u043d\u0444\u0443 \u043f\u043e \u043f\u0430\u0442\u0447\u0430\u043c <a href=\"https:\/\/github.com\/skaes\/rvm-patchsets\">https:\/\/github.com\/skaes\/rvm-patchsets<\/a> \t\t\t \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/165627\/\"> http:\/\/habrahabr.ru\/post\/165627\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0440\u0435\u043b\u044c\u0441\u043e\u0432, \u0430 \u0437\u0430\u043e\u0434\u043d\u043e \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440\u0430 ruby.<br \/>  \u041e \u0442\u043e\u043c \u043a\u0430\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c RVM (Ruby version manager) \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0430\u0442\u0435\u0439, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0435\u0440\u0435\u0439\u0434\u0443 \u0441\u0440\u0430\u0437\u0443 \u043a \u0434\u0435\u043b\u0443.<br \/>  \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0430\u0442\u0447\u0435\u0439 \u0432 RailsExpress \u0434\u043b\u044f Ruby 1.9.3-p362 <br \/>  (\u044d\u0442\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0440\u0443\u0431\u0438 \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438)  <\/p>\n<pre><code class=\"bash\">Applying patch railsexpress\/01-fix-make-clean.patch Applying patch railsexpress\/02-railsbench-gc.patch Applying patch railsexpress\/03-display-more-detailed-stack-trace.patch Applying patch railsexpress\/04-fork-support-for-gc-logging.patch Applying patch railsexpress\/05-track-live-dataset-size.patch Applying patch railsexpress\/06-webrick_204_304_keep_alive_fix.patch Applying patch railsexpress\/07-export-a-few-more-symbols-for-ruby-prof.patch Applying patch railsexpress\/08-thread-variables.patch Applying patch railsexpress\/09-faster-loading.patch Applying patch railsexpress\/10-falcon-st-opt.patch Applying patch railsexpress\/11-falcon-sparse-array.patch Applying patch railsexpress\/12-falcon-array-queue.patch <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-165627","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=165627"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/165627\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=165627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=165627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=165627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}