{"action":"opened","number":168,"pull_request":{"url":"https://api.github.com/repos/gnumdk/lollypop/pulls/168","id":37929451,"html_url":"https://github.com/gnumdk/lollypop/pull/168","diff_url":"https://github.com/gnumdk/lollypop/pull/168.diff","patch_url":"https://github.com/gnumdk/lollypop/pull/168.patch","issue_url":"https://api.github.com/repos/gnumdk/lollypop/issues/168","number":168,"state":"open","locked":false,"title":"Removed slow search for existing selectionlist items","user":{"login":"slosd","id":99086,"avatar_url":"https://avatars.githubusercontent.com/u/99086?v=3","gravatar_id":"","url":"https://api.github.com/users/slosd","html_url":"https://github.com/slosd","followers_url":"https://api.github.com/users/slosd/followers","following_url":"https://api.github.com/users/slosd/following{/other_user}","gists_url":"https://api.github.com/users/slosd/gists{/gist_id}","starred_url":"https://api.github.com/users/slosd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slosd/subscriptions","organizations_url":"https://api.github.com/users/slosd/orgs","repos_url":"https://api.github.com/users/slosd/repos","events_url":"https://api.github.com/users/slosd/events{/privacy}","received_events_url":"https://api.github.com/users/slosd/received_events","type":"User","site_admin":false},"body":"When the selectionlist is filled with more than just a few items (445 artists in my case) they appear really slowly in the UI. This is caused by a slow search for existing items. In `update_values` there are `len(self._model) * len(values)` comparisons. This method also calls `add_value` which looks for existing items again. So `2 * len(self._model) * len(values)` comparisons in total. \r\n\r\nMy changes instead create a set of item ids and look up ids of new items there. I also removed the unnecessary thread for `populate` and simplified `add_values`. ","created_at":"2015-06-17T18:04:47Z","updated_at":"2015-06-17T18:04:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gnumdk/lollypop/pulls/168/commits","review_comments_url":"https://api.github.com/repos/gnumdk/lollypop/pulls/168/comments","review_comment_url":"https://api.github.com/repos/gnumdk/lollypop/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gnumdk/lollypop/issues/168/comments","statuses_url":"https://api.github.com/repos/gnumdk/lollypop/statuses/7dd0f1007a31225318d562a400670e79d83e3941","head":{"label":"slosd:improve-performance","ref":"improve-performance","sha":"7dd0f1007a31225318d562a400670e79d83e3941","user":{"login":"slosd","id":99086,"avatar_url":"https://avatars.githubusercontent.com/u/99086?v=3","gravatar_id":"","url":"https://api.github.com/users/slosd","html_url":"https://github.com/slosd","followers_url":"https://api.github.com/users/slosd/followers","following_url":"https://api.github.com/users/slosd/following{/other_user}","gists_url":"https://api.github.com/users/slosd/gists{/gist_id}","starred_url":"https://api.github.com/users/slosd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slosd/subscriptions","organizations_url":"https://api.github.com/users/slosd/orgs","repos_url":"https://api.github.com/users/slosd/repos","events_url":"https://api.github.com/users/slosd/events{/privacy}","received_events_url":"https://api.github.com/users/slosd/received_events","type":"User","site_admin":false},"repo":{"id":37597030,"name":"lollypop","full_name":"slosd/lollypop","owner":{"login":"slosd","id":99086,"avatar_url":"https://avatars.githubusercontent.com/u/99086?v=3","gravatar_id":"","url":"https://api.github.com/users/slosd","html_url":"https://github.com/slosd","followers_url":"https://api.github.com/users/slosd/followers","following_url":"https://api.github.com/users/slosd/following{/other_user}","gists_url":"https://api.github.com/users/slosd/gists{/gist_id}","starred_url":"https://api.github.com/users/slosd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slosd/subscriptions","organizations_url":"https://api.github.com/users/slosd/orgs","repos_url":"https://api.github.com/users/slosd/repos","events_url":"https://api.github.com/users/slosd/events{/privacy}","received_events_url":"https://api.github.com/users/slosd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/slosd/lollypop","description":"Lollypop","fork":true,"url":"https://api.github.com/repos/slosd/lollypop","forks_url":"https://api.github.com/repos/slosd/lollypop/forks","keys_url":"https://api.github.com/repos/slosd/lollypop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slosd/lollypop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slosd/lollypop/teams","hooks_url":"https://api.github.com/repos/slosd/lollypop/hooks","issue_events_url":"https://api.github.com/repos/slosd/lollypop/issues/events{/number}","events_url":"https://api.github.com/repos/slosd/lollypop/events","assignees_url":"https://api.github.com/repos/slosd/lollypop/assignees{/user}","branches_url":"https://api.github.com/repos/slosd/lollypop/branches{/branch}","tags_url":"https://api.github.com/repos/slosd/lollypop/tags","blobs_url":"https://api.github.com/repos/slosd/lollypop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slosd/lollypop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slosd/lollypop/git/refs{/sha}","trees_url":"https://api.github.com/repos/slosd/lollypop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slosd/lollypop/statuses/{sha}","languages_url":"https://api.github.com/repos/slosd/lollypop/languages","stargazers_url":"https://api.github.com/repos/slosd/lollypop/stargazers","contributors_url":"https://api.github.com/repos/slosd/lollypop/contributors","subscribers_url":"https://api.github.com/repos/slosd/lollypop/subscribers","subscription_url":"https://api.github.com/repos/slosd/lollypop/subscription","commits_url":"https://api.github.com/repos/slosd/lollypop/commits{/sha}","git_commits_url":"https://api.github.com/repos/slosd/lollypop/git/commits{/sha}","comments_url":"https://api.github.com/repos/slosd/lollypop/comments{/number}","issue_comment_url":"https://api.github.com/repos/slosd/lollypop/issues/comments{/number}","contents_url":"https://api.github.com/repos/slosd/lollypop/contents/{+path}","compare_url":"https://api.github.com/repos/slosd/lollypop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slosd/lollypop/merges","archive_url":"https://api.github.com/repos/slosd/lollypop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slosd/lollypop/downloads","issues_url":"https://api.github.com/repos/slosd/lollypop/issues{/number}","pulls_url":"https://api.github.com/repos/slosd/lollypop/pulls{/number}","milestones_url":"https://api.github.com/repos/slosd/lollypop/milestones{/number}","notifications_url":"https://api.github.com/repos/slosd/lollypop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slosd/lollypop/labels{/name}","releases_url":"https://api.github.com/repos/slosd/lollypop/releases{/id}","created_at":"2015-06-17T13:37:54Z","updated_at":"2015-06-17T13:37:54Z","pushed_at":"2015-06-17T17:47:09Z","git_url":"git://github.com/slosd/lollypop.git","ssh_url":"git@github.com:slosd/lollypop.git","clone_url":"https://github.com/slosd/lollypop.git","svn_url":"https://github.com/slosd/lollypop","homepage":"","size":14539,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gnumdk:master","ref":"master","sha":"77eaddd282b8de14f8c741730ce761508c6b59af","user":{"login":"gnumdk","id":3918824,"avatar_url":"https://avatars.githubusercontent.com/u/3918824?v=3","gravatar_id":"","url":"https://api.github.com/users/gnumdk","html_url":"https://github.com/gnumdk","followers_url":"https://api.github.com/users/gnumdk/followers","following_url":"https://api.github.com/users/gnumdk/following{/other_user}","gists_url":"https://api.github.com/users/gnumdk/gists{/gist_id}","starred_url":"https://api.github.com/users/gnumdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnumdk/subscriptions","organizations_url":"https://api.github.com/users/gnumdk/orgs","repos_url":"https://api.github.com/users/gnumdk/repos","events_url":"https://api.github.com/users/gnumdk/events{/privacy}","received_events_url":"https://api.github.com/users/gnumdk/received_events","type":"User","site_admin":false},"repo":{"id":24725587,"name":"lollypop","full_name":"gnumdk/lollypop","owner":{"login":"gnumdk","id":3918824,"avatar_url":"https://avatars.githubusercontent.com/u/3918824?v=3","gravatar_id":"","url":"https://api.github.com/users/gnumdk","html_url":"https://github.com/gnumdk","followers_url":"https://api.github.com/users/gnumdk/followers","following_url":"https://api.github.com/users/gnumdk/following{/other_user}","gists_url":"https://api.github.com/users/gnumdk/gists{/gist_id}","starred_url":"https://api.github.com/users/gnumdk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnumdk/subscriptions","organizations_url":"https://api.github.com/users/gnumdk/orgs","repos_url":"https://api.github.com/users/gnumdk/repos","events_url":"https://api.github.com/users/gnumdk/events{/privacy}","received_events_url":"https://api.github.com/users/gnumdk/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gnumdk/lollypop","description":"Lollypop","fork":false,"url":"https://api.github.com/repos/gnumdk/lollypop","forks_url":"https://api.github.com/repos/gnumdk/lollypop/forks","keys_url":"https://api.github.com/repos/gnumdk/lollypop/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gnumdk/lollypop/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gnumdk/lollypop/teams","hooks_url":"https://api.github.com/repos/gnumdk/lollypop/hooks","issue_events_url":"https://api.github.com/repos/gnumdk/lollypop/issues/events{/number}","events_url":"https://api.github.com/repos/gnumdk/lollypop/events","assignees_url":"https://api.github.com/repos/gnumdk/lollypop/assignees{/user}","branches_url":"https://api.github.com/repos/gnumdk/lollypop/branches{/branch}","tags_url":"https://api.github.com/repos/gnumdk/lollypop/tags","blobs_url":"https://api.github.com/repos/gnumdk/lollypop/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gnumdk/lollypop/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gnumdk/lollypop/git/refs{/sha}","trees_url":"https://api.github.com/repos/gnumdk/lollypop/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gnumdk/lollypop/statuses/{sha}","languages_url":"https://api.github.com/repos/gnumdk/lollypop/languages","stargazers_url":"https://api.github.com/repos/gnumdk/lollypop/stargazers","contributors_url":"https://api.github.com/repos/gnumdk/lollypop/contributors","subscribers_url":"https://api.github.com/repos/gnumdk/lollypop/subscribers","subscription_url":"https://api.github.com/repos/gnumdk/lollypop/subscription","commits_url":"https://api.github.com/repos/gnumdk/lollypop/commits{/sha}","git_commits_url":"https://api.github.com/repos/gnumdk/lollypop/git/commits{/sha}","comments_url":"https://api.github.com/repos/gnumdk/lollypop/comments{/number}","issue_comment_url":"https://api.github.com/repos/gnumdk/lollypop/issues/comments{/number}","contents_url":"https://api.github.com/repos/gnumdk/lollypop/contents/{+path}","compare_url":"https://api.github.com/repos/gnumdk/lollypop/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gnumdk/lollypop/merges","archive_url":"https://api.github.com/repos/gnumdk/lollypop/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gnumdk/lollypop/downloads","issues_url":"https://api.github.com/repos/gnumdk/lollypop/issues{/number}","pulls_url":"https://api.github.com/repos/gnumdk/lollypop/pulls{/number}","milestones_url":"https://api.github.com/repos/gnumdk/lollypop/milestones{/number}","notifications_url":"https://api.github.com/repos/gnumdk/lollypop/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gnumdk/lollypop/labels{/name}","releases_url":"https://api.github.com/repos/gnumdk/lollypop/releases{/id}","created_at":"2014-10-02T15:53:07Z","updated_at":"2015-06-17T12:22:19Z","pushed_at":"2015-06-17T17:47:04Z","git_url":"git://github.com/gnumdk/lollypop.git","ssh_url":"git@github.com:gnumdk/lollypop.git","clone_url":"https://github.com/gnumdk/lollypop.git","svn_url":"https://github.com/gnumdk/lollypop","homepage":"","size":14539,"stargazers_count":143,"watchers_count":143,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":143,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gnumdk/lollypop/pulls/168"},"html":{"href":"https://github.com/gnumdk/lollypop/pull/168"},"issue":{"href":"https://api.github.com/repos/gnumdk/lollypop/issues/168"},"comments":{"href":"https://api.github.com/repos/gnumdk/lollypop/issues/168/comments"},"review_comments":{"href":"https://api.github.com/repos/gnumdk/lollypop/pulls/168/comments"},"review_comment":{"href":"https://api.github.com/repos/gnumdk/lollypop/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gnumdk/lollypop/pulls/168/commits"},"statuses":{"href":"https://api.github.com/repos/gnumdk/lollypop/statuses/7dd0f1007a31225318d562a400670e79d83e3941"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":19,"deletions":52,"changed_files":2}}