{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12895","repository_url":"https://api.github.com/repos/ManageIQ/manageiq","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12895/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12895/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12895/events","html_url":"https://github.com/ManageIQ/manageiq/pull/12895","id":192188399,"number":12895,"title":"Memory improvements in routes.rb","user":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"labels":[{"id":228525610,"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/core","name":"core","color":"5319e7","default":false},{"id":129042774,"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/performance","name":"performance","color":"fad8c7","default":false}],"state":"open","locked":false,"assignee":{"login":"jrafanie","id":19339,"avatar_url":"https://avatars.githubusercontent.com/u/19339?v=3","gravatar_id":"","url":"https://api.github.com/users/jrafanie","html_url":"https://github.com/jrafanie","followers_url":"https://api.github.com/users/jrafanie/followers","following_url":"https://api.github.com/users/jrafanie/following{/other_user}","gists_url":"https://api.github.com/users/jrafanie/gists{/gist_id}","starred_url":"https://api.github.com/users/jrafanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrafanie/subscriptions","organizations_url":"https://api.github.com/users/jrafanie/orgs","repos_url":"https://api.github.com/users/jrafanie/repos","events_url":"https://api.github.com/users/jrafanie/events{/privacy}","received_events_url":"https://api.github.com/users/jrafanie/received_events","type":"User","site_admin":false},"assignees":[{"login":"jrafanie","id":19339,"avatar_url":"https://avatars.githubusercontent.com/u/19339?v=3","gravatar_id":"","url":"https://api.github.com/users/jrafanie","html_url":"https://github.com/jrafanie","followers_url":"https://api.github.com/users/jrafanie/followers","following_url":"https://api.github.com/users/jrafanie/following{/other_user}","gists_url":"https://api.github.com/users/jrafanie/gists{/gist_id}","starred_url":"https://api.github.com/users/jrafanie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrafanie/subscriptions","organizations_url":"https://api.github.com/users/jrafanie/orgs","repos_url":"https://api.github.com/users/jrafanie/repos","events_url":"https://api.github.com/users/jrafanie/events{/privacy}","received_events_url":"https://api.github.com/users/jrafanie/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-11-29T05:00:32Z","updated_at":"2016-11-29T05:12:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/12895","html_url":"https://github.com/ManageIQ/manageiq/pull/12895","diff_url":"https://github.com/ManageIQ/manageiq/pull/12895.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/12895.patch"},"body":"The primary change is to consolidate common routes with constraints.  Rails' route loader is very expensive as you add individual match elements.  By consolidating all of the actions for a controller into a single match entry, and using a regex to validate the action, we can still whitelist, but eliminate an enormous number of entries in Rails' route loader.\r\n\r\nWith a simpler rails runner process\r\n\r\n|         | Memory         | Time         | Route entries |\r\n|---------|----------------|--------------|---------------|\r\n| Before  | 187_430_229 MB | 6.838s       | 3798          |\r\n| After   | 166_028_629 MB | 6.142s       | 656           |\r\n| Savings | ~21 MB (11.4%) | 0.7s (10.2%) | 3142 (82.7%)  |\r\n\r\n---\r\n\r\nAdditionally\r\n- I moved the routes file into a YAML file.  Although this doesn't reflect much in memory savings, it eliminates a great number of Ruby VM entries for the strings, which impacts GC times.\r\n- I cleaned up some of the API constants\r\n\r\n@jrafanie Please review.\r\n"},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/263478219","html_url":"https://github.com/ManageIQ/manageiq/pull/12895#issuecomment-263478219","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/12895","id":263478219,"user":{"login":"miq-bot","id":7806257,"avatar_url":"https://avatars.githubusercontent.com/u/7806257?v=3","gravatar_id":"","url":"https://api.github.com/users/miq-bot","html_url":"https://github.com/miq-bot","followers_url":"https://api.github.com/users/miq-bot/followers","following_url":"https://api.github.com/users/miq-bot/following{/other_user}","gists_url":"https://api.github.com/users/miq-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/miq-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miq-bot/subscriptions","organizations_url":"https://api.github.com/users/miq-bot/orgs","repos_url":"https://api.github.com/users/miq-bot/repos","events_url":"https://api.github.com/users/miq-bot/events{/privacy}","received_events_url":"https://api.github.com/users/miq-bot/received_events","type":"User","site_admin":false},"created_at":"2016-11-29T05:12:26Z","updated_at":"2016-11-29T05:12:26Z","body":"<rubocop />Checked commits https://github.com/Fryguy/manageiq/compare/cea67888de3b4c94b7dd9d52cc7462d11e16d106~...2f2b756c4ae40c19414761b43e69bc50911dae38 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1\n1 file checked, 1 offense detected\n\n**config/routes.rb**\n- [ ] :exclamation: - [Line 85](https://github.com/Fryguy/manageiq/blob/2f2b756c4ae40c19414761b43e69bc50911dae38/config/routes.rb#L85), Col 5 - [Style/Next](http://rubydoc.info/gems/rubocop/0.37.2/RuboCop/Cop/Style/Next) - Use `next` to skip iteration.\n"}}
{"actor":{"display_login":"miq-bot"}}