{"action":"created","issue":{"url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/95","labels_url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/95/comments","events_url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/95/events","html_url":"https://github.com/cfpb/hmda-rule-engine/pull/95","id":60147033,"number":95,"title":"Reducing the creation of unnecessary hidden classes in V8","user":{"login":"porterbot","id":10199649,"avatar_url":"https://avatars.githubusercontent.com/u/10199649?v=3","gravatar_id":"","url":"https://api.github.com/users/porterbot","html_url":"https://github.com/porterbot","followers_url":"https://api.github.com/users/porterbot/followers","following_url":"https://api.github.com/users/porterbot/following{/other_user}","gists_url":"https://api.github.com/users/porterbot/gists{/gist_id}","starred_url":"https://api.github.com/users/porterbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/porterbot/subscriptions","organizations_url":"https://api.github.com/users/porterbot/orgs","repos_url":"https://api.github.com/users/porterbot/repos","events_url":"https://api.github.com/users/porterbot/events{/privacy}","received_events_url":"https://api.github.com/users/porterbot/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-06T19:29:36Z","updated_at":"2015-03-12T16:13:43Z","closed_at":"2015-03-12T16:13:43Z","pull_request":{"url":"https://api.github.com/repos/cfpb/hmda-rule-engine/pulls/95","html_url":"https://github.com/cfpb/hmda-rule-engine/pull/95","diff_url":"https://github.com/cfpb/hmda-rule-engine/pull/95.diff","patch_url":"https://github.com/cfpb/hmda-rule-engine/pull/95.patch"},"body":"After doing some research (http://www.html5rocks.com/en/tutorials/speed/v8/ and http://www.developerknowhow.com/why-the-v8-javascript-engine-is-so-good/), it looks like the way we were creating the hmdaFile data was creating a lot of unnecessary hidden classes because we assign the properties on the fly.  After converting the LoanApplicationRegister to using a prototype function instead, I saw pretty dramatic reduction of memory in Chrome (for bankofthewest, 52MB heap size using existing vs. 30.9MB using prototypes.  I was unable to test on Firefox, because I can't install firefox on my cfpb laptop, but I imagine SpiderMonkey does some optimization like V8.  I ran it through the timing harness and didn't see any reduction of speed, so since this is a small lift and doesn't really require much refactoring, set it to create a prototype function based off the rule spec."},"comment":{"url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/comments/78513219","html_url":"https://github.com/cfpb/hmda-rule-engine/pull/95#issuecomment-78513219","issue_url":"https://api.github.com/repos/cfpb/hmda-rule-engine/issues/95","id":78513219,"user":{"login":"LinuxBozo","id":723420,"avatar_url":"https://avatars.githubusercontent.com/u/723420?v=3","gravatar_id":"","url":"https://api.github.com/users/LinuxBozo","html_url":"https://github.com/LinuxBozo","followers_url":"https://api.github.com/users/LinuxBozo/followers","following_url":"https://api.github.com/users/LinuxBozo/following{/other_user}","gists_url":"https://api.github.com/users/LinuxBozo/gists{/gist_id}","starred_url":"https://api.github.com/users/LinuxBozo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinuxBozo/subscriptions","organizations_url":"https://api.github.com/users/LinuxBozo/orgs","repos_url":"https://api.github.com/users/LinuxBozo/repos","events_url":"https://api.github.com/users/LinuxBozo/events{/privacy}","received_events_url":"https://api.github.com/users/LinuxBozo/received_events","type":"User","site_admin":false},"created_at":"2015-03-12T16:13:43Z","updated_at":"2015-03-12T16:13:43Z","body":"Closing this in favor of #99 "}}