{"action":"created","issue":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/1452","labels_url":"https://api.github.com/repos/medic/medic-webapp/issues/1452/labels{/name}","comments_url":"https://api.github.com/repos/medic/medic-webapp/issues/1452/comments","events_url":"https://api.github.com/repos/medic/medic-webapp/issues/1452/events","html_url":"https://github.com/medic/medic-webapp/issues/1452","id":112059696,"number":1452,"title":"Task generator performance","user":{"login":"garethbowen","id":2064938,"avatar_url":"https://avatars.githubusercontent.com/u/2064938?v=3","gravatar_id":"","url":"https://api.github.com/users/garethbowen","html_url":"https://github.com/garethbowen","followers_url":"https://api.github.com/users/garethbowen/followers","following_url":"https://api.github.com/users/garethbowen/following{/other_user}","gists_url":"https://api.github.com/users/garethbowen/gists{/gist_id}","starred_url":"https://api.github.com/users/garethbowen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garethbowen/subscriptions","organizations_url":"https://api.github.com/users/garethbowen/orgs","repos_url":"https://api.github.com/users/garethbowen/repos","events_url":"https://api.github.com/users/garethbowen/events{/privacy}","received_events_url":"https://api.github.com/users/garethbowen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/medic/medic-webapp/labels/3%20-%20Code%20Review","name":"3 - Code Review","color":"fad8c7"},{"url":"https://api.github.com/repos/medic/medic-webapp/labels/Performance","name":"Performance","color":"f7c6c7"}],"state":"open","locked":false,"assignee":{"login":"mandric","id":25641,"avatar_url":"https://avatars.githubusercontent.com/u/25641?v=3","gravatar_id":"","url":"https://api.github.com/users/mandric","html_url":"https://github.com/mandric","followers_url":"https://api.github.com/users/mandric/followers","following_url":"https://api.github.com/users/mandric/following{/other_user}","gists_url":"https://api.github.com/users/mandric/gists{/gist_id}","starred_url":"https://api.github.com/users/mandric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mandric/subscriptions","organizations_url":"https://api.github.com/users/mandric/orgs","repos_url":"https://api.github.com/users/mandric/repos","events_url":"https://api.github.com/users/mandric/events{/privacy}","received_events_url":"https://api.github.com/users/mandric/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/medic/medic-webapp/milestones/38","html_url":"https://github.com/medic/medic-webapp/milestones/Iteration%202015-43:%20Field%20Test%20Preparation","labels_url":"https://api.github.com/repos/medic/medic-webapp/milestones/38/labels","id":1365219,"number":38,"title":"Iteration 2015-43: Field Test Preparation","description":"This is the final iteration before our pre-field-test feature freeze.","creator":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":6,"state":"open","created_at":"2015-10-20T01:17:20Z","updated_at":"2015-10-21T21:46:37Z","due_on":"2015-11-02T08:00:00Z","closed_at":null},"comments":3,"created_at":"2015-10-19T02:19:53Z","updated_at":"2015-10-21T22:16:32Z","closed_at":null,"body":"Every interaction with the TaskGenerator gets all the contacts and reports from the database, compiles the task rules, and generates the tasks. This is now proving a performance bottleneck.\r\n\r\nSome ideas to improve performance:\r\n\r\n1. cache results in the task generator and expire the cache every x minutes\r\n2. cache results in the task generator and listen for changes to reports or contacts to expire the cache\r\n3. use a changes listener and keep nools running and provide new facts to the engine on change\r\n\r\nCurrently the user provided configuration has to decide whether tasks are emitted based on the relevant date. It might be better to have the nools configuration emit all tasks and filter in the task generator. That way items to show could change over time without rerunning the rules which would be particularly useful for option 3."},"comment":{"url":"https://api.github.com/repos/medic/medic-webapp/issues/comments/150040324","html_url":"https://github.com/medic/medic-webapp/issues/1452#issuecomment-150040324","issue_url":"https://api.github.com/repos/medic/medic-webapp/issues/1452","id":150040324,"user":{"login":"browndav","id":763977,"avatar_url":"https://avatars.githubusercontent.com/u/763977?v=3","gravatar_id":"","url":"https://api.github.com/users/browndav","html_url":"https://github.com/browndav","followers_url":"https://api.github.com/users/browndav/followers","following_url":"https://api.github.com/users/browndav/following{/other_user}","gists_url":"https://api.github.com/users/browndav/gists{/gist_id}","starred_url":"https://api.github.com/users/browndav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/browndav/subscriptions","organizations_url":"https://api.github.com/users/browndav/orgs","repos_url":"https://api.github.com/users/browndav/repos","events_url":"https://api.github.com/users/browndav/events{/privacy}","received_events_url":"https://api.github.com/users/browndav/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T22:16:32Z","updated_at":"2015-10-21T22:16:32Z","body":"@mandric: Assigned for code review."}}