{"action":"created","issue":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6729","repository_url":"https://api.github.com/repos/rapid7/metasploit-framework","labels_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6729/labels{/name}","comments_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6729/comments","events_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6729/events","html_url":"https://github.com/rapid7/metasploit-framework/pull/6729","id":144711912,"number":6729,"title":"Speed up the datastore","user":{"login":"acammack-r7","id":16652544,"avatar_url":"https://avatars.githubusercontent.com/u/16652544?v=3","gravatar_id":"","url":"https://api.github.com/users/acammack-r7","html_url":"https://github.com/acammack-r7","followers_url":"https://api.github.com/users/acammack-r7/followers","following_url":"https://api.github.com/users/acammack-r7/following{/other_user}","gists_url":"https://api.github.com/users/acammack-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/acammack-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acammack-r7/subscriptions","organizations_url":"https://api.github.com/users/acammack-r7/orgs","repos_url":"https://api.github.com/users/acammack-r7/repos","events_url":"https://api.github.com/users/acammack-r7/events{/privacy}","received_events_url":"https://api.github.com/users/acammack-r7/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/enhancement","name":"enhancement","color":"5319e7"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/in%20progress","name":"in progress","color":"ededed"},{"url":"https://api.github.com/repos/rapid7/metasploit-framework/labels/library","name":"library","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-30T20:33:27Z","updated_at":"2016-04-02T03:13:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/pulls/6729","html_url":"https://github.com/rapid7/metasploit-framework/pull/6729","diff_url":"https://github.com/rapid7/metasploit-framework/pull/6729.diff","patch_url":"https://github.com/rapid7/metasploit-framework/pull/6729.patch"},"body":"Before, the datastore would store options case-sensitive, but would access them case-insensitive, resulting is a number of string compares. This commit stores options in their downcase form to reduce update/lookup time. This adds up to reducing msfconsole boot time by about 10% and rspec time by about 45 sec. (!) on my box.\r\n\r\nOne tricky part of this conversion is that there are several places (in pro and framework) where we export or otherwise access the datastore as a plain hash (case-sensitive). I believe I have caught all the ways we access the datastore that are case-sensitive and substituted the original key capitalization in those cases.\r\n\r\nIdeally, I would like to not have to keep track of case in the datastore, but that would require wide, coordinated changes.\r\n\r\nThe now removed `#find_key_case` from the call graph generated by `./msfconsole -qx \"exit\"`:\r\n<img width=\"662\" alt=\"screen shot 2016-03-29 at 18 25 31\" src=\"https://cloud.githubusercontent.com/assets/16652544/14156299/4921a63a-f68b-11e5-8ba3-70f78d498487.png\">\r\n(absolute and relative times slightly skewed by tracing)\r\n\r\nVerification\r\n========\r\n- [ ] The specs should be green\r\n- [ ] Your favorite modules should accept options as before"},"comment":{"url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/comments/204637021","html_url":"https://github.com/rapid7/metasploit-framework/pull/6729#issuecomment-204637021","issue_url":"https://api.github.com/repos/rapid7/metasploit-framework/issues/6729","id":204637021,"user":{"login":"sempervictus","id":1331084,"avatar_url":"https://avatars.githubusercontent.com/u/1331084?v=3","gravatar_id":"","url":"https://api.github.com/users/sempervictus","html_url":"https://github.com/sempervictus","followers_url":"https://api.github.com/users/sempervictus/followers","following_url":"https://api.github.com/users/sempervictus/following{/other_user}","gists_url":"https://api.github.com/users/sempervictus/gists{/gist_id}","starred_url":"https://api.github.com/users/sempervictus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sempervictus/subscriptions","organizations_url":"https://api.github.com/users/sempervictus/orgs","repos_url":"https://api.github.com/users/sempervictus/repos","events_url":"https://api.github.com/users/sempervictus/events{/privacy}","received_events_url":"https://api.github.com/users/sempervictus/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T03:13:08Z","updated_at":"2016-04-02T03:13:08Z","body":"Hmm, should have made that case insensitive to begin with, good catch.\r\nMerging for testing, but looks sane at first glance, thanks for addressing such a massive time consumer."}}