{"action":"closed","number":21638,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/21638","id":45109097,"html_url":"https://github.com/rails/rails/pull/21638","diff_url":"https://github.com/rails/rails/pull/21638.diff","patch_url":"https://github.com/rails/rails/pull/21638.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/21638","number":21638,"state":"closed","locked":false,"title":"Avoid saving whole fixture sets for each test class","user":{"login":"BlakeMesdag","id":696663,"avatar_url":"https://avatars.githubusercontent.com/u/696663?v=3","gravatar_id":"","url":"https://api.github.com/users/BlakeMesdag","html_url":"https://github.com/BlakeMesdag","followers_url":"https://api.github.com/users/BlakeMesdag/followers","following_url":"https://api.github.com/users/BlakeMesdag/following{/other_user}","gists_url":"https://api.github.com/users/BlakeMesdag/gists{/gist_id}","starred_url":"https://api.github.com/users/BlakeMesdag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlakeMesdag/subscriptions","organizations_url":"https://api.github.com/users/BlakeMesdag/orgs","repos_url":"https://api.github.com/users/BlakeMesdag/repos","events_url":"https://api.github.com/users/BlakeMesdag/events{/privacy}","received_events_url":"https://api.github.com/users/BlakeMesdag/received_events","type":"User","site_admin":false},"body":"This changes to a single global cache of fixtures rather than using a test suite level cache. This reduces cumulative memory bloat on large test suites.\r\n\r\nFor a small selection of our test suite (884/37369 tests) this uses 2.3402% less memory. Considering we have 37369 tests this can save quite a bit of memory overall.\r\n\r\nThe following code was added to our test helper to verify usage:\r\n``` ruby\r\nMiniTest.after_run do\r\n  GC.start\r\n  puts GC.stat[:total_allocated_object]\r\nend\r\n```\r\n\r\nAnd here are some samples:\r\n```\r\nGC.stat[:total_allocated_objects] before: 109594085, 106998967, 106998967\r\nbefore total allocation average: 107864006\r\n\r\nGC.stat[:total_allocated_objects] after: 106417688, 106417045, 106417813\r\nafter total allocation average: 106417515\r\n\r\naverage total allocation difference: 1.342%\r\n\r\nmemory usage before: 1153.55859375 MB\r\nmemory usage after: 1126.5625 MB\r\n\r\nmemory saved: 2.3402%\r\n```\r\n\r\n@arthurnn @rafaelfranca ","created_at":"2015-09-15T22:10:44Z","updated_at":"2015-11-04T16:05:52Z","closed_at":"2015-11-04T16:05:52Z","merged_at":null,"merge_commit_sha":"ad42317b2b41fe0bb9d82e919b98fb6760e7c4b3","assignee":{"login":"tenderlove","id":3124,"avatar_url":"https://avatars.githubusercontent.com/u/3124?v=3","gravatar_id":"","url":"https://api.github.com/users/tenderlove","html_url":"https://github.com/tenderlove","followers_url":"https://api.github.com/users/tenderlove/followers","following_url":"https://api.github.com/users/tenderlove/following{/other_user}","gists_url":"https://api.github.com/users/tenderlove/gists{/gist_id}","starred_url":"https://api.github.com/users/tenderlove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tenderlove/subscriptions","organizations_url":"https://api.github.com/users/tenderlove/orgs","repos_url":"https://api.github.com/users/tenderlove/repos","events_url":"https://api.github.com/users/tenderlove/events{/privacy}","received_events_url":"https://api.github.com/users/tenderlove/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/21638/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/21638/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/21638/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/28d782acca887da5693a970b82503433cfb7738a","head":{"label":"BlakeMesdag:master-less-global-fixture-bloat","ref":"master-less-global-fixture-bloat","sha":"28d782acca887da5693a970b82503433cfb7738a","user":{"login":"BlakeMesdag","id":696663,"avatar_url":"https://avatars.githubusercontent.com/u/696663?v=3","gravatar_id":"","url":"https://api.github.com/users/BlakeMesdag","html_url":"https://github.com/BlakeMesdag","followers_url":"https://api.github.com/users/BlakeMesdag/followers","following_url":"https://api.github.com/users/BlakeMesdag/following{/other_user}","gists_url":"https://api.github.com/users/BlakeMesdag/gists{/gist_id}","starred_url":"https://api.github.com/users/BlakeMesdag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlakeMesdag/subscriptions","organizations_url":"https://api.github.com/users/BlakeMesdag/orgs","repos_url":"https://api.github.com/users/BlakeMesdag/repos","events_url":"https://api.github.com/users/BlakeMesdag/events{/privacy}","received_events_url":"https://api.github.com/users/BlakeMesdag/received_events","type":"User","site_admin":false},"repo":{"id":15947738,"name":"rails","full_name":"BlakeMesdag/rails","owner":{"login":"BlakeMesdag","id":696663,"avatar_url":"https://avatars.githubusercontent.com/u/696663?v=3","gravatar_id":"","url":"https://api.github.com/users/BlakeMesdag","html_url":"https://github.com/BlakeMesdag","followers_url":"https://api.github.com/users/BlakeMesdag/followers","following_url":"https://api.github.com/users/BlakeMesdag/following{/other_user}","gists_url":"https://api.github.com/users/BlakeMesdag/gists{/gist_id}","starred_url":"https://api.github.com/users/BlakeMesdag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlakeMesdag/subscriptions","organizations_url":"https://api.github.com/users/BlakeMesdag/orgs","repos_url":"https://api.github.com/users/BlakeMesdag/repos","events_url":"https://api.github.com/users/BlakeMesdag/events{/privacy}","received_events_url":"https://api.github.com/users/BlakeMesdag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BlakeMesdag/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/BlakeMesdag/rails","forks_url":"https://api.github.com/repos/BlakeMesdag/rails/forks","keys_url":"https://api.github.com/repos/BlakeMesdag/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BlakeMesdag/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BlakeMesdag/rails/teams","hooks_url":"https://api.github.com/repos/BlakeMesdag/rails/hooks","issue_events_url":"https://api.github.com/repos/BlakeMesdag/rails/issues/events{/number}","events_url":"https://api.github.com/repos/BlakeMesdag/rails/events","assignees_url":"https://api.github.com/repos/BlakeMesdag/rails/assignees{/user}","branches_url":"https://api.github.com/repos/BlakeMesdag/rails/branches{/branch}","tags_url":"https://api.github.com/repos/BlakeMesdag/rails/tags","blobs_url":"https://api.github.com/repos/BlakeMesdag/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BlakeMesdag/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BlakeMesdag/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/BlakeMesdag/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BlakeMesdag/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/BlakeMesdag/rails/languages","stargazers_url":"https://api.github.com/repos/BlakeMesdag/rails/stargazers","contributors_url":"https://api.github.com/repos/BlakeMesdag/rails/contributors","subscribers_url":"https://api.github.com/repos/BlakeMesdag/rails/subscribers","subscription_url":"https://api.github.com/repos/BlakeMesdag/rails/subscription","commits_url":"https://api.github.com/repos/BlakeMesdag/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/BlakeMesdag/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/BlakeMesdag/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/BlakeMesdag/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/BlakeMesdag/rails/contents/{+path}","compare_url":"https://api.github.com/repos/BlakeMesdag/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BlakeMesdag/rails/merges","archive_url":"https://api.github.com/repos/BlakeMesdag/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BlakeMesdag/rails/downloads","issues_url":"https://api.github.com/repos/BlakeMesdag/rails/issues{/number}","pulls_url":"https://api.github.com/repos/BlakeMesdag/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/BlakeMesdag/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/BlakeMesdag/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BlakeMesdag/rails/labels{/name}","releases_url":"https://api.github.com/repos/BlakeMesdag/rails/releases{/id}","created_at":"2014-01-15T20:43:45Z","updated_at":"2015-03-10T00:47:43Z","pushed_at":"2015-10-13T19:45:42Z","git_url":"git://github.com/BlakeMesdag/rails.git","ssh_url":"git@github.com:BlakeMesdag/rails.git","clone_url":"https://github.com/BlakeMesdag/rails.git","svn_url":"https://github.com/BlakeMesdag/rails","homepage":"http://rubyonrails.org","size":144158,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"9d05430c956c4ae1d0aefda02def5052ea818433","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-11-04T14:57:34Z","pushed_at":"2015-11-04T16:03:47Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":620904,"stargazers_count":28268,"watchers_count":28268,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11430,"mirror_url":null,"open_issues_count":818,"forks":11430,"open_issues":818,"watchers":28268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/21638"},"html":{"href":"https://github.com/rails/rails/pull/21638"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/21638"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/21638/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/21638/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/21638/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/28d782acca887da5693a970b82503433cfb7738a"}},"merged":false,"mergeable":true,"mergeable_state":"unstable","merged_by":null,"comments":6,"review_comments":4,"commits":1,"additions":4,"deletions":4,"changed_files":1}}