{"action":"created","issue":{"url":"https://api.github.com/repos/adzap/validates_timeliness/issues/128","labels_url":"https://api.github.com/repos/adzap/validates_timeliness/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/adzap/validates_timeliness/issues/128/comments","events_url":"https://api.github.com/repos/adzap/validates_timeliness/issues/128/events","html_url":"https://github.com/adzap/validates_timeliness/pull/128","id":108192553,"number":128,"title":"Generate attribute methods once instead of on each object creation","user":{"login":"monkbroc","id":1919681,"avatar_url":"https://avatars.githubusercontent.com/u/1919681?v=3","gravatar_id":"","url":"https://api.github.com/users/monkbroc","html_url":"https://github.com/monkbroc","followers_url":"https://api.github.com/users/monkbroc/followers","following_url":"https://api.github.com/users/monkbroc/following{/other_user}","gists_url":"https://api.github.com/users/monkbroc/gists{/gist_id}","starred_url":"https://api.github.com/users/monkbroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkbroc/subscriptions","organizations_url":"https://api.github.com/users/monkbroc/orgs","repos_url":"https://api.github.com/users/monkbroc/repos","events_url":"https://api.github.com/users/monkbroc/events{/privacy}","received_events_url":"https://api.github.com/users/monkbroc/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-24T18:58:19Z","updated_at":"2015-09-25T12:52:33Z","closed_at":"2015-09-24T23:13:02Z","pull_request":{"url":"https://api.github.com/repos/adzap/validates_timeliness/pulls/128","html_url":"https://github.com/adzap/validates_timeliness/pull/128","diff_url":"https://github.com/adzap/validates_timeliness/pull/128.diff","patch_url":"https://github.com/adzap/validates_timeliness/pull/128.patch"},"body":"This is a memory and performance improvement change.\r\n\r\nThe attribute methods for timeliness are generated at each object creation instead of once, at first creation like AR attribute methods. Since creating those methods uses `module_eval` it's quite slow when it's done each `Model.new`.\r\n\r\nFor more details on the performance improvement, see the same change on John Carney's fork: https://github.com/johncarney/validates_timeliness/pull/6"},"comment":{"url":"https://api.github.com/repos/adzap/validates_timeliness/issues/comments/143211211","html_url":"https://github.com/adzap/validates_timeliness/pull/128#issuecomment-143211211","issue_url":"https://api.github.com/repos/adzap/validates_timeliness/issues/128","id":143211211,"user":{"login":"monkbroc","id":1919681,"avatar_url":"https://avatars.githubusercontent.com/u/1919681?v=3","gravatar_id":"","url":"https://api.github.com/users/monkbroc","html_url":"https://github.com/monkbroc","followers_url":"https://api.github.com/users/monkbroc/followers","following_url":"https://api.github.com/users/monkbroc/following{/other_user}","gists_url":"https://api.github.com/users/monkbroc/gists{/gist_id}","starred_url":"https://api.github.com/users/monkbroc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monkbroc/subscriptions","organizations_url":"https://api.github.com/users/monkbroc/orgs","repos_url":"https://api.github.com/users/monkbroc/repos","events_url":"https://api.github.com/users/monkbroc/events{/privacy}","received_events_url":"https://api.github.com/users/monkbroc/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T12:52:33Z","updated_at":"2015-09-25T12:52:33Z","body":"It's around 1000 string per object creation. On an index page with 20\nobjects it saved 20,000 string allocations out of a total of 90,000\nallocations for that request.\nOn Sep 25, 2015 12:01 AM, \"Adam Meehan\" <notifications@github.com> wrote:\n\n> Thanks for the great work! How many allocations did it save? I realise\n> this is not a generalisable number but I am just interested.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/adzap/validates_timeliness/pull/128#issuecomment-143118148>\n> .\n>\n"}}