{"action":"created","issue":{"url":"https://api.github.com/repos/rubygems/rubygems.org/issues/1179","labels_url":"https://api.github.com/repos/rubygems/rubygems.org/issues/1179/labels{/name}","comments_url":"https://api.github.com/repos/rubygems/rubygems.org/issues/1179/comments","events_url":"https://api.github.com/repos/rubygems/rubygems.org/issues/1179/events","html_url":"https://github.com/rubygems/rubygems.org/pull/1179","id":127148340,"number":1179,"title":"boot time improvements","user":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":23,"created_at":"2016-01-18T03:45:05Z","updated_at":"2016-01-22T15:49:57Z","closed_at":"2016-01-22T15:49:57Z","pull_request":{"url":"https://api.github.com/repos/rubygems/rubygems.org/pulls/1179","html_url":"https://github.com/rubygems/rubygems.org/pull/1179","diff_url":"https://github.com/rubygems/rubygems.org/pull/1179.diff","patch_url":"https://github.com/rubygems/rubygems.org/pull/1179.patch"},"body":"### Problem\r\nRails is slow. After a few months of development, my Rails app takes more time to load, it is not as fast as it used to be. 😢 \r\n\r\nNote: I know this is not a rubygems.org problem per-say, however this is a really common problem in Rails apps, and usually devs dont know what to do. And also, this isn't a Rails issues. So I think someone needs to start given a good example, and hopefully the community will start following some good patterns and have apps that boot faster.\r\n\r\nI decided to take a look, and see how far I could get and to try to cut down boot time as much as possible.\r\n\r\n### Main idea\r\n- Remove `Bundler.require` code\r\n- Lazy load as much as possible\r\n- Cache paths on require, to speedup rubugems require code\r\n\r\nBesides speed there are other advantages to lazy load things:\r\n- Things are a bit less magical, and we can see better what we are using\r\n- Future gems added to Gemfile, wont slow things down\r\n\r\nSimilar work done by @indirect , and posted here http://andre.arko.net/2014/06/27/rails-in-05-seconds/ 👏 \r\n\r\nthoughts @evanphx @qrush @dwradcliffe @sferik \r\ncc @rafaelfranca @schneems\r\n\r\n#### Show me some numbers\r\nBefore:\r\n```\r\n[arthurnn@snowball rubygems.org]$ time bin/rails runner '0'\r\n\r\nreal\t0m3.214s\r\nuser\t0m2.516s\r\nsys\t0m0.671s\r\n```\r\n\r\nAfter:\r\n```\r\n[arthurnn@snowball rubygems.org]$ time bin/rails runner '0'\r\n\r\nreal\t0m1.778s\r\nuser\t0m1.591s\r\nsys\t0m0.177s\r\n```"},"comment":{"url":"https://api.github.com/repos/rubygems/rubygems.org/issues/comments/173958426","html_url":"https://github.com/rubygems/rubygems.org/pull/1179#issuecomment-173958426","issue_url":"https://api.github.com/repos/rubygems/rubygems.org/issues/1179","id":173958426,"user":{"login":"arthurnn","id":833383,"avatar_url":"https://avatars.githubusercontent.com/u/833383?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurnn","html_url":"https://github.com/arthurnn","followers_url":"https://api.github.com/users/arthurnn/followers","following_url":"https://api.github.com/users/arthurnn/following{/other_user}","gists_url":"https://api.github.com/users/arthurnn/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurnn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurnn/subscriptions","organizations_url":"https://api.github.com/users/arthurnn/orgs","repos_url":"https://api.github.com/users/arthurnn/repos","events_url":"https://api.github.com/users/arthurnn/events{/privacy}","received_events_url":"https://api.github.com/users/arthurnn/received_events","type":"User","site_admin":true},"created_at":"2016-01-22T15:49:57Z","updated_at":"2016-01-22T15:49:57Z","body":"@qrush I think this was a productive discussion. Will close it, and work in a few follow up points. However will keep the \"Rails Way\" , and invest my time on spring.\r\n\r\nThanks everyone. ❤️ "}}