{"action":"closed","number":48,"pull_request":{"url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48","id":81980638,"html_url":"https://github.com/zopefoundation/zope.interface/pull/48","diff_url":"https://github.com/zopefoundation/zope.interface/pull/48.diff","patch_url":"https://github.com/zopefoundation/zope.interface/pull/48.patch","issue_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/48","number":48,"state":"closed","locked":false,"title":"Use dictionary lookups for testing subscribed status.","user":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"body":"Fixes #46.\r\n\r\nBenchmarks show a dramatic improvement; not quite as good as the demonstration in #46 because the implementation had to be a bit more complex to properly handle unregistration, but still very good. Here it is with 20,000 items already registered:\r\n```\r\n   %time add_to_reg(reg, 1000)\r\n   CPU times: user 190 ms, sys: 19.3 ms, total: 209 ms\r\n   Wall time: 203 ms\r\n```\r\n\r\nHere's a profile with about 100,000 utilities registered:\r\n```\r\n %prun add_to_reg(reg, 1000)\r\n         80005 function calls (79005 primitive calls) in 0.713 seconds\r\n\r\n   Ordered by: internal time\r\n\r\n   ncalls  tottime  percall  cumtime  percall filename:lineno(function)\r\n     1000    0.596    0.001    0.621    0.001 adapter.py:202(subscribe)\r\n    12000    0.016    0.000    0.019    0.000 interface.py:518(__hash__)\r\n     1000    0.010    0.000    0.709    0.001 registry.py:206(registerUtility)\r\n3000/2000    0.009    0.000    0.014    0.000 interface.py:255(interfaces)\r\n     2000    0.008    0.000    0.022    0.000 adapter.py:637(changed)\r\n     1000    0.008    0.000    0.025    0.000 registry.py:498(_getUtilityProvided)\r\n     9000    0.008    0.000    0.017    0.000 {method 'get' of 'dict' objects}\r\n     1000    0.008    0.000    0.027    0.000 adapter.py:102(register)\r\n     2000    0.006    0.000    0.008    0.000 adapter.py:450(changed)\r\n     1000    0.005    0.000    0.663    0.001 registry.py:145(registerUtility)\r\n```\r\n\r\nI was very careful not to change the pickle at all. (Thus the weakrefs.)\r\n\r\nzope.interface and zope.component tests have been run and both pass. (It was necessary to account for the underlying objects changing because of the way zope.component cleans up after tests.) I show 100% test coverage still.","created_at":"2016-08-19T13:26:53Z","updated_at":"2016-08-30T14:50:17Z","closed_at":"2016-08-30T14:50:17Z","merged_at":"2016-08-30T14:50:16Z","merge_commit_sha":"4ad360e44ec52b742750c8201676d7fe934f5f2a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48/commits","review_comments_url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48/comments","review_comment_url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/48/comments","statuses_url":"https://api.github.com/repos/zopefoundation/zope.interface/statuses/1e2b756500b7b8518884ff4c3bd8bd64e62641a4","head":{"label":"zopefoundation:fix-46","ref":"fix-46","sha":"1e2b756500b7b8518884ff4c3bd8bd64e62641a4","user":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":7491085,"name":"zope.interface","full_name":"zopefoundation/zope.interface","owner":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zopefoundation/zope.interface","description":"Interfaces for Python","fork":false,"url":"https://api.github.com/repos/zopefoundation/zope.interface","forks_url":"https://api.github.com/repos/zopefoundation/zope.interface/forks","keys_url":"https://api.github.com/repos/zopefoundation/zope.interface/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zopefoundation/zope.interface/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zopefoundation/zope.interface/teams","hooks_url":"https://api.github.com/repos/zopefoundation/zope.interface/hooks","issue_events_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/events{/number}","events_url":"https://api.github.com/repos/zopefoundation/zope.interface/events","assignees_url":"https://api.github.com/repos/zopefoundation/zope.interface/assignees{/user}","branches_url":"https://api.github.com/repos/zopefoundation/zope.interface/branches{/branch}","tags_url":"https://api.github.com/repos/zopefoundation/zope.interface/tags","blobs_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/refs{/sha}","trees_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zopefoundation/zope.interface/statuses/{sha}","languages_url":"https://api.github.com/repos/zopefoundation/zope.interface/languages","stargazers_url":"https://api.github.com/repos/zopefoundation/zope.interface/stargazers","contributors_url":"https://api.github.com/repos/zopefoundation/zope.interface/contributors","subscribers_url":"https://api.github.com/repos/zopefoundation/zope.interface/subscribers","subscription_url":"https://api.github.com/repos/zopefoundation/zope.interface/subscription","commits_url":"https://api.github.com/repos/zopefoundation/zope.interface/commits{/sha}","git_commits_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/commits{/sha}","comments_url":"https://api.github.com/repos/zopefoundation/zope.interface/comments{/number}","issue_comment_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/comments{/number}","contents_url":"https://api.github.com/repos/zopefoundation/zope.interface/contents/{+path}","compare_url":"https://api.github.com/repos/zopefoundation/zope.interface/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zopefoundation/zope.interface/merges","archive_url":"https://api.github.com/repos/zopefoundation/zope.interface/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zopefoundation/zope.interface/downloads","issues_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues{/number}","pulls_url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls{/number}","milestones_url":"https://api.github.com/repos/zopefoundation/zope.interface/milestones{/number}","notifications_url":"https://api.github.com/repos/zopefoundation/zope.interface/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zopefoundation/zope.interface/labels{/name}","releases_url":"https://api.github.com/repos/zopefoundation/zope.interface/releases{/id}","deployments_url":"https://api.github.com/repos/zopefoundation/zope.interface/deployments","created_at":"2013-01-07T22:25:00Z","updated_at":"2016-08-30T05:59:55Z","pushed_at":"2016-08-30T14:50:17Z","git_url":"git://github.com/zopefoundation/zope.interface.git","ssh_url":"git@github.com:zopefoundation/zope.interface.git","clone_url":"https://github.com/zopefoundation/zope.interface.git","svn_url":"https://github.com/zopefoundation/zope.interface","homepage":"http://zopeinterface.readthedocs.io/","size":726,"stargazers_count":53,"watchers_count":53,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":20,"forks":21,"open_issues":20,"watchers":53,"default_branch":"master"}},"base":{"label":"zopefoundation:master","ref":"master","sha":"8138c73db26b17ca1967daa2908845b2d2f21cb8","user":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"repo":{"id":7491085,"name":"zope.interface","full_name":"zopefoundation/zope.interface","owner":{"login":"zopefoundation","id":1163184,"avatar_url":"https://avatars.githubusercontent.com/u/1163184?v=3","gravatar_id":"","url":"https://api.github.com/users/zopefoundation","html_url":"https://github.com/zopefoundation","followers_url":"https://api.github.com/users/zopefoundation/followers","following_url":"https://api.github.com/users/zopefoundation/following{/other_user}","gists_url":"https://api.github.com/users/zopefoundation/gists{/gist_id}","starred_url":"https://api.github.com/users/zopefoundation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zopefoundation/subscriptions","organizations_url":"https://api.github.com/users/zopefoundation/orgs","repos_url":"https://api.github.com/users/zopefoundation/repos","events_url":"https://api.github.com/users/zopefoundation/events{/privacy}","received_events_url":"https://api.github.com/users/zopefoundation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zopefoundation/zope.interface","description":"Interfaces for Python","fork":false,"url":"https://api.github.com/repos/zopefoundation/zope.interface","forks_url":"https://api.github.com/repos/zopefoundation/zope.interface/forks","keys_url":"https://api.github.com/repos/zopefoundation/zope.interface/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zopefoundation/zope.interface/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zopefoundation/zope.interface/teams","hooks_url":"https://api.github.com/repos/zopefoundation/zope.interface/hooks","issue_events_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/events{/number}","events_url":"https://api.github.com/repos/zopefoundation/zope.interface/events","assignees_url":"https://api.github.com/repos/zopefoundation/zope.interface/assignees{/user}","branches_url":"https://api.github.com/repos/zopefoundation/zope.interface/branches{/branch}","tags_url":"https://api.github.com/repos/zopefoundation/zope.interface/tags","blobs_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/refs{/sha}","trees_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zopefoundation/zope.interface/statuses/{sha}","languages_url":"https://api.github.com/repos/zopefoundation/zope.interface/languages","stargazers_url":"https://api.github.com/repos/zopefoundation/zope.interface/stargazers","contributors_url":"https://api.github.com/repos/zopefoundation/zope.interface/contributors","subscribers_url":"https://api.github.com/repos/zopefoundation/zope.interface/subscribers","subscription_url":"https://api.github.com/repos/zopefoundation/zope.interface/subscription","commits_url":"https://api.github.com/repos/zopefoundation/zope.interface/commits{/sha}","git_commits_url":"https://api.github.com/repos/zopefoundation/zope.interface/git/commits{/sha}","comments_url":"https://api.github.com/repos/zopefoundation/zope.interface/comments{/number}","issue_comment_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues/comments{/number}","contents_url":"https://api.github.com/repos/zopefoundation/zope.interface/contents/{+path}","compare_url":"https://api.github.com/repos/zopefoundation/zope.interface/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zopefoundation/zope.interface/merges","archive_url":"https://api.github.com/repos/zopefoundation/zope.interface/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zopefoundation/zope.interface/downloads","issues_url":"https://api.github.com/repos/zopefoundation/zope.interface/issues{/number}","pulls_url":"https://api.github.com/repos/zopefoundation/zope.interface/pulls{/number}","milestones_url":"https://api.github.com/repos/zopefoundation/zope.interface/milestones{/number}","notifications_url":"https://api.github.com/repos/zopefoundation/zope.interface/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zopefoundation/zope.interface/labels{/name}","releases_url":"https://api.github.com/repos/zopefoundation/zope.interface/releases{/id}","deployments_url":"https://api.github.com/repos/zopefoundation/zope.interface/deployments","created_at":"2013-01-07T22:25:00Z","updated_at":"2016-08-30T05:59:55Z","pushed_at":"2016-08-30T14:50:17Z","git_url":"git://github.com/zopefoundation/zope.interface.git","ssh_url":"git@github.com:zopefoundation/zope.interface.git","clone_url":"https://github.com/zopefoundation/zope.interface.git","svn_url":"https://github.com/zopefoundation/zope.interface","homepage":"http://zopeinterface.readthedocs.io/","size":726,"stargazers_count":53,"watchers_count":53,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":20,"forks":21,"open_issues":20,"watchers":53,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48"},"html":{"href":"https://github.com/zopefoundation/zope.interface/pull/48"},"issue":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/issues/48"},"comments":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/issues/48/comments"},"review_comments":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48/comments"},"review_comment":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/pulls/48/commits"},"statuses":{"href":"https://api.github.com/repos/zopefoundation/zope.interface/statuses/1e2b756500b7b8518884ff4c3bd8bd64e62641a4"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"jamadden","id":1256082,"avatar_url":"https://avatars.githubusercontent.com/u/1256082?v=3","gravatar_id":"","url":"https://api.github.com/users/jamadden","html_url":"https://github.com/jamadden","followers_url":"https://api.github.com/users/jamadden/followers","following_url":"https://api.github.com/users/jamadden/following{/other_user}","gists_url":"https://api.github.com/users/jamadden/gists{/gist_id}","starred_url":"https://api.github.com/users/jamadden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamadden/subscriptions","organizations_url":"https://api.github.com/users/jamadden/orgs","repos_url":"https://api.github.com/users/jamadden/repos","events_url":"https://api.github.com/users/jamadden/events{/privacy}","received_events_url":"https://api.github.com/users/jamadden/received_events","type":"User","site_admin":false},"comments":16,"review_comments":3,"commits":4,"additions":276,"deletions":75,"changed_files":4}}
{"actor":{"display_login":"jamadden"}}