{"action":"created","issue":{"url":"https://api.github.com/repos/dcos/dcos-ui/issues/837","repository_url":"https://api.github.com/repos/dcos/dcos-ui","labels_url":"https://api.github.com/repos/dcos/dcos-ui/issues/837/labels{/name}","comments_url":"https://api.github.com/repos/dcos/dcos-ui/issues/837/comments","events_url":"https://api.github.com/repos/dcos/dcos-ui/issues/837/events","html_url":"https://github.com/dcos/dcos-ui/pull/837","id":167305030,"number":837,"title":"Memoize task IDs","user":{"login":"philipnrmn","id":2989362,"avatar_url":"https://avatars.githubusercontent.com/u/2989362?v=3","gravatar_id":"","url":"https://api.github.com/users/philipnrmn","html_url":"https://github.com/philipnrmn","followers_url":"https://api.github.com/users/philipnrmn/followers","following_url":"https://api.github.com/users/philipnrmn/following{/other_user}","gists_url":"https://api.github.com/users/philipnrmn/gists{/gist_id}","starred_url":"https://api.github.com/users/philipnrmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philipnrmn/subscriptions","organizations_url":"https://api.github.com/users/philipnrmn/orgs","repos_url":"https://api.github.com/users/philipnrmn/repos","events_url":"https://api.github.com/users/philipnrmn/events{/privacy}","received_events_url":"https://api.github.com/users/philipnrmn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dcos/dcos-ui/labels/assignee","name":"assignee","color":"0e8a16"}],"state":"open","locked":false,"assignee":{"login":"aldipower","id":859154,"avatar_url":"https://avatars.githubusercontent.com/u/859154?v=3","gravatar_id":"","url":"https://api.github.com/users/aldipower","html_url":"https://github.com/aldipower","followers_url":"https://api.github.com/users/aldipower/followers","following_url":"https://api.github.com/users/aldipower/following{/other_user}","gists_url":"https://api.github.com/users/aldipower/gists{/gist_id}","starred_url":"https://api.github.com/users/aldipower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldipower/subscriptions","organizations_url":"https://api.github.com/users/aldipower/orgs","repos_url":"https://api.github.com/users/aldipower/repos","events_url":"https://api.github.com/users/aldipower/events{/privacy}","received_events_url":"https://api.github.com/users/aldipower/received_events","type":"User","site_admin":false},"assignees":[{"login":"aldipower","id":859154,"avatar_url":"https://avatars.githubusercontent.com/u/859154?v=3","gravatar_id":"","url":"https://api.github.com/users/aldipower","html_url":"https://github.com/aldipower","followers_url":"https://api.github.com/users/aldipower/followers","following_url":"https://api.github.com/users/aldipower/following{/other_user}","gists_url":"https://api.github.com/users/aldipower/gists{/gist_id}","starred_url":"https://api.github.com/users/aldipower/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldipower/subscriptions","organizations_url":"https://api.github.com/users/aldipower/orgs","repos_url":"https://api.github.com/users/aldipower/repos","events_url":"https://api.github.com/users/aldipower/events{/privacy}","received_events_url":"https://api.github.com/users/aldipower/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-07-25T07:57:07Z","updated_at":"2016-07-25T16:18:06Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dcos/dcos-ui/pulls/837","html_url":"https://github.com/dcos/dcos-ui/pull/837","diff_url":"https://github.com/dcos/dcos-ui/pull/837.diff","patch_url":"https://github.com/dcos/dcos-ui/pull/837.patch"},"body":"This is the simplest possible implementation of a task ID cache - we simply memoize in order to make repeated calls to `getTaskByTaskID(taskID)` inexpensive. \r\n\r\nPotential improvements: smarter cache-busting (we bust on every poll at present); denormalization on data load. "},"comment":{"url":"https://api.github.com/repos/dcos/dcos-ui/issues/comments/235002985","html_url":"https://github.com/dcos/dcos-ui/pull/837#issuecomment-235002985","issue_url":"https://api.github.com/repos/dcos/dcos-ui/issues/837","id":235002985,"user":{"login":"MatApple","id":465022,"avatar_url":"https://avatars.githubusercontent.com/u/465022?v=3","gravatar_id":"","url":"https://api.github.com/users/MatApple","html_url":"https://github.com/MatApple","followers_url":"https://api.github.com/users/MatApple/followers","following_url":"https://api.github.com/users/MatApple/following{/other_user}","gists_url":"https://api.github.com/users/MatApple/gists{/gist_id}","starred_url":"https://api.github.com/users/MatApple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatApple/subscriptions","organizations_url":"https://api.github.com/users/MatApple/orgs","repos_url":"https://api.github.com/users/MatApple/repos","events_url":"https://api.github.com/users/MatApple/events{/privacy}","received_events_url":"https://api.github.com/users/MatApple/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T16:18:06Z","updated_at":"2016-07-25T16:18:06Z","body":"@philipnrmn just wondering if this is the correct approach. Memoization will reduce the 2 - n lookups to O(1) but the first lookup of every task is still expensive. I'm wondering how often we will be looking these tasks up more than once before we get a new set of data and the cache is cleared.\r\n\r\nWhat if we looped through all tasks of all services and maintained a map of {taskId: task}, whenever we get new data so we don't have the expensive find operation?"}}
{"actor":{"display_login":"MatApple"}}