{"action":"created","comment":{"url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/comments/233881145","pull_request_review_id":175397020,"id":233881145,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMzg4MTE0NQ==","diff_hunk":"@@ -1001,6 +1001,166 @@ def __str__(self):\n     setattr(proxied_list, '__eq__', getattr(proxied_list, '_eq'))\n     setattr(proxied_list, '__ne__', getattr(proxied_list, '_ne'))\n \n+@cython.cclass\n+class proxied_frozenset(object):\n+\n+    cython.declare(objlist = object)\n+\n+    def __init__(self, objlist):\n+        self.objlist = objlist\n+\n+    @classmethod\n+    def pack_into(cls, obj, buf, offs, idmap = None, implicit_offs = 0):\n+        return mapped_frozenset.pack_into(obj, buf, offs, idmap, implicit_offs, sort=True)\n+\n+    @classmethod\n+    @cython.locals(\n+        i=int, j=int, offs=cython.longlong,\n+        pybuf='Py_buffer', pbuf='const unsigned char *', b=cython.uchar)\n+    def unpack_from(cls, buf, offs, idmap = None):\n+        buf = _likerobuffer(buf)\n+        if cython.compiled:\n+            PyObject_GetBuffer(buf, cython.address(pybuf), PyBUF_SIMPLE)\n+            pbuf = cython.cast(cython.p_uchar, pybuf.buf)\n+            if offs >= pybuf.len:\n+                PyBuffer_Release(cython.address(pybuf))\n+                raise IndexError(\"Offset out of range\")\n+        else:\n+            pbuf = buf\n+        try:\n+            if pbuf[offs] == 'm':\n+                # inline bitmap\n+                if cython.compiled and offs+7 >= pybuf.len:\n+                    raise IndexError(\"Object spans beyond buffer end\")\n+                rv = []\n+                for i in xrange(7):\n+                    b = ord(pbuf[offs+1+i])\n+                    if b:\n+                        for j in xrange(8):\n+                            if b & (1<<j):\n+                                rv.append(i*8+j)\n+                return frozenset(rv)\n+            else:\n+                return proxied_frozenset(proxied_list(buf, offs, idmap))\n+        finally:\n+            if cython.compiled:\n+                if type(buf) is buffer:\n+                    PyBuffer_Release(cython.address(pybuf))\n+\n+    def copy(self):\n+        return self\n+\n+    def __len__(self):\n+        return len(self.objlist)\n+\n+    @cython.locals(i1=cython.Py_ssize_t, i2=cython.Py_ssize_t,\n+        cnt=cython.Py_ssize_t, step=cython.Py_ssize_t, lst='proxied_list')\n+    def __contains__(self, elem):\n+        i1 = 0\n+        i2 = len(self.objlist)\n+        cnt = i2 - i1\n+        lst = self.objlist\n+\n+        while cnt > 0:\n+            step = cnt >> 1\n+            val = lst._getitem(step)\n+            if val == elem:\n+                return True\n+            elif val < elem:\n+                cnt -= step + 1\n+            else:\n+                cnt = step\n+        return False\n+\n+    def __iter__(self):\n+        return iter(self.objlist)\n+\n+    def union(self, *seqs):\n+        return frozenset(self).union(*seqs)\n+\n+    def intersection(self, *seqs):\n+        return frozenset(self).intersection(*seqs)\n+\n+    def difference(self, *seqs):\n+        return frozenset(self).difference(*seqs)\n+\n+    def symmetric_difference(self, *seqs):\n+        return frozenset(self).symmetric_difference(*seqs)\n+\n+    def __eq__(self, seq):\n+        if not isinstance(seq, (set, frozenset, proxied_frozenset, mapped_frozenset)) or (\n+              len(self) != len(seq)):\n+            return False\n+        for val in self:","path":"sharedbuffers/mapped_struct.py","position":122,"original_position":123,"commit_id":"81f62d3b069d0a3dfdbfa7d9959ff590ae2ac552","original_commit_id":"47284fd681a8adba40deee24e45633f23c16f4f3","user":{"login":"klaussfreire","id":1746892,"node_id":"MDQ6VXNlcjE3NDY4OTI=","avatar_url":"https://avatars2.githubusercontent.com/u/1746892?v=4","gravatar_id":"","url":"https://api.github.com/users/klaussfreire","html_url":"https://github.com/klaussfreire","followers_url":"https://api.github.com/users/klaussfreire/followers","following_url":"https://api.github.com/users/klaussfreire/following{/other_user}","gists_url":"https://api.github.com/users/klaussfreire/gists{/gist_id}","starred_url":"https://api.github.com/users/klaussfreire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klaussfreire/subscriptions","organizations_url":"https://api.github.com/users/klaussfreire/orgs","repos_url":"https://api.github.com/users/klaussfreire/repos","events_url":"https://api.github.com/users/klaussfreire/events{/privacy}","received_events_url":"https://api.github.com/users/klaussfreire/received_events","type":"User","site_admin":false},"body":"`for val in self` has to construct and iterate a generator.\r\n\r\nYes, it's very high overhead, even if we optimize the generator. At the very least you should inline the generator loop to avoid the generator indirection.","created_at":"2018-11-15T15:11:54Z","updated_at":"2018-11-15T15:11:54Z","html_url":"https://github.com/jampp/sharedbuffers/pull/59#discussion_r233881145","pull_request_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/comments/233881145"},"html":{"href":"https://github.com/jampp/sharedbuffers/pull/59#discussion_r233881145"},"pull_request":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59"}},"in_reply_to_id":233592646},"pull_request":{"url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59","id":230948610,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwOTQ4NjEw","html_url":"https://github.com/jampp/sharedbuffers/pull/59","diff_url":"https://github.com/jampp/sharedbuffers/pull/59.diff","patch_url":"https://github.com/jampp/sharedbuffers/pull/59.patch","issue_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/59","number":59,"state":"open","locked":false,"title":"Proxied frozenset","user":{"login":"llogiudice","id":32463772,"node_id":"MDQ6VXNlcjMyNDYzNzcy","avatar_url":"https://avatars0.githubusercontent.com/u/32463772?v=4","gravatar_id":"","url":"https://api.github.com/users/llogiudice","html_url":"https://github.com/llogiudice","followers_url":"https://api.github.com/users/llogiudice/followers","following_url":"https://api.github.com/users/llogiudice/following{/other_user}","gists_url":"https://api.github.com/users/llogiudice/gists{/gist_id}","starred_url":"https://api.github.com/users/llogiudice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llogiudice/subscriptions","organizations_url":"https://api.github.com/users/llogiudice/orgs","repos_url":"https://api.github.com/users/llogiudice/repos","events_url":"https://api.github.com/users/llogiudice/events{/privacy}","received_events_url":"https://api.github.com/users/llogiudice/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-14T19:10:19Z","updated_at":"2018-11-15T15:11:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9118e2da28fce2303119f8265eefee135b3079d1","assignee":null,"assignees":[],"requested_reviewers":[{"login":"gefarion","id":1751005,"node_id":"MDQ6VXNlcjE3NTEwMDU=","avatar_url":"https://avatars3.githubusercontent.com/u/1751005?v=4","gravatar_id":"","url":"https://api.github.com/users/gefarion","html_url":"https://github.com/gefarion","followers_url":"https://api.github.com/users/gefarion/followers","following_url":"https://api.github.com/users/gefarion/following{/other_user}","gists_url":"https://api.github.com/users/gefarion/gists{/gist_id}","starred_url":"https://api.github.com/users/gefarion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gefarion/subscriptions","organizations_url":"https://api.github.com/users/gefarion/orgs","repos_url":"https://api.github.com/users/gefarion/repos","events_url":"https://api.github.com/users/gefarion/events{/privacy}","received_events_url":"https://api.github.com/users/gefarion/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59/commits","review_comments_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59/comments","review_comment_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/59/comments","statuses_url":"https://api.github.com/repos/jampp/sharedbuffers/statuses/81f62d3b069d0a3dfdbfa7d9959ff590ae2ac552","head":{"label":"jampp:proxied_frozenset","ref":"proxied_frozenset","sha":"81f62d3b069d0a3dfdbfa7d9959ff590ae2ac552","user":{"login":"jampp","id":13048969,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDQ4OTY5","avatar_url":"https://avatars0.githubusercontent.com/u/13048969?v=4","gravatar_id":"","url":"https://api.github.com/users/jampp","html_url":"https://github.com/jampp","followers_url":"https://api.github.com/users/jampp/followers","following_url":"https://api.github.com/users/jampp/following{/other_user}","gists_url":"https://api.github.com/users/jampp/gists{/gist_id}","starred_url":"https://api.github.com/users/jampp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jampp/subscriptions","organizations_url":"https://api.github.com/users/jampp/orgs","repos_url":"https://api.github.com/users/jampp/repos","events_url":"https://api.github.com/users/jampp/events{/privacy}","received_events_url":"https://api.github.com/users/jampp/received_events","type":"Organization","site_admin":false},"repo":{"id":70011533,"node_id":"MDEwOlJlcG9zaXRvcnk3MDAxMTUzMw==","name":"sharedbuffers","full_name":"jampp/sharedbuffers","private":false,"owner":{"login":"jampp","id":13048969,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDQ4OTY5","avatar_url":"https://avatars0.githubusercontent.com/u/13048969?v=4","gravatar_id":"","url":"https://api.github.com/users/jampp","html_url":"https://github.com/jampp","followers_url":"https://api.github.com/users/jampp/followers","following_url":"https://api.github.com/users/jampp/following{/other_user}","gists_url":"https://api.github.com/users/jampp/gists{/gist_id}","starred_url":"https://api.github.com/users/jampp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jampp/subscriptions","organizations_url":"https://api.github.com/users/jampp/orgs","repos_url":"https://api.github.com/users/jampp/repos","events_url":"https://api.github.com/users/jampp/events{/privacy}","received_events_url":"https://api.github.com/users/jampp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jampp/sharedbuffers","description":null,"fork":false,"url":"https://api.github.com/repos/jampp/sharedbuffers","forks_url":"https://api.github.com/repos/jampp/sharedbuffers/forks","keys_url":"https://api.github.com/repos/jampp/sharedbuffers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jampp/sharedbuffers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jampp/sharedbuffers/teams","hooks_url":"https://api.github.com/repos/jampp/sharedbuffers/hooks","issue_events_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/events{/number}","events_url":"https://api.github.com/repos/jampp/sharedbuffers/events","assignees_url":"https://api.github.com/repos/jampp/sharedbuffers/assignees{/user}","branches_url":"https://api.github.com/repos/jampp/sharedbuffers/branches{/branch}","tags_url":"https://api.github.com/repos/jampp/sharedbuffers/tags","blobs_url":"https://api.github.com/repos/jampp/sharedbuffers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jampp/sharedbuffers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jampp/sharedbuffers/git/refs{/sha}","trees_url":"https://api.github.com/repos/jampp/sharedbuffers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jampp/sharedbuffers/statuses/{sha}","languages_url":"https://api.github.com/repos/jampp/sharedbuffers/languages","stargazers_url":"https://api.github.com/repos/jampp/sharedbuffers/stargazers","contributors_url":"https://api.github.com/repos/jampp/sharedbuffers/contributors","subscribers_url":"https://api.github.com/repos/jampp/sharedbuffers/subscribers","subscription_url":"https://api.github.com/repos/jampp/sharedbuffers/subscription","commits_url":"https://api.github.com/repos/jampp/sharedbuffers/commits{/sha}","git_commits_url":"https://api.github.com/repos/jampp/sharedbuffers/git/commits{/sha}","comments_url":"https://api.github.com/repos/jampp/sharedbuffers/comments{/number}","issue_comment_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/comments{/number}","contents_url":"https://api.github.com/repos/jampp/sharedbuffers/contents/{+path}","compare_url":"https://api.github.com/repos/jampp/sharedbuffers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jampp/sharedbuffers/merges","archive_url":"https://api.github.com/repos/jampp/sharedbuffers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jampp/sharedbuffers/downloads","issues_url":"https://api.github.com/repos/jampp/sharedbuffers/issues{/number}","pulls_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls{/number}","milestones_url":"https://api.github.com/repos/jampp/sharedbuffers/milestones{/number}","notifications_url":"https://api.github.com/repos/jampp/sharedbuffers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jampp/sharedbuffers/labels{/name}","releases_url":"https://api.github.com/repos/jampp/sharedbuffers/releases{/id}","deployments_url":"https://api.github.com/repos/jampp/sharedbuffers/deployments","created_at":"2016-10-04T22:26:03Z","updated_at":"2018-11-15T14:26:53Z","pushed_at":"2018-11-15T15:04:33Z","git_url":"git://github.com/jampp/sharedbuffers.git","ssh_url":"git@github.com:jampp/sharedbuffers.git","clone_url":"https://github.com/jampp/sharedbuffers.git","svn_url":"https://github.com/jampp/sharedbuffers","homepage":null,"size":574,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":7,"watchers":10,"default_branch":"master"}},"base":{"label":"jampp:master","ref":"master","sha":"b64b9e746dc97d254768960a6a3fc07101265db4","user":{"login":"jampp","id":13048969,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDQ4OTY5","avatar_url":"https://avatars0.githubusercontent.com/u/13048969?v=4","gravatar_id":"","url":"https://api.github.com/users/jampp","html_url":"https://github.com/jampp","followers_url":"https://api.github.com/users/jampp/followers","following_url":"https://api.github.com/users/jampp/following{/other_user}","gists_url":"https://api.github.com/users/jampp/gists{/gist_id}","starred_url":"https://api.github.com/users/jampp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jampp/subscriptions","organizations_url":"https://api.github.com/users/jampp/orgs","repos_url":"https://api.github.com/users/jampp/repos","events_url":"https://api.github.com/users/jampp/events{/privacy}","received_events_url":"https://api.github.com/users/jampp/received_events","type":"Organization","site_admin":false},"repo":{"id":70011533,"node_id":"MDEwOlJlcG9zaXRvcnk3MDAxMTUzMw==","name":"sharedbuffers","full_name":"jampp/sharedbuffers","private":false,"owner":{"login":"jampp","id":13048969,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMDQ4OTY5","avatar_url":"https://avatars0.githubusercontent.com/u/13048969?v=4","gravatar_id":"","url":"https://api.github.com/users/jampp","html_url":"https://github.com/jampp","followers_url":"https://api.github.com/users/jampp/followers","following_url":"https://api.github.com/users/jampp/following{/other_user}","gists_url":"https://api.github.com/users/jampp/gists{/gist_id}","starred_url":"https://api.github.com/users/jampp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jampp/subscriptions","organizations_url":"https://api.github.com/users/jampp/orgs","repos_url":"https://api.github.com/users/jampp/repos","events_url":"https://api.github.com/users/jampp/events{/privacy}","received_events_url":"https://api.github.com/users/jampp/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jampp/sharedbuffers","description":null,"fork":false,"url":"https://api.github.com/repos/jampp/sharedbuffers","forks_url":"https://api.github.com/repos/jampp/sharedbuffers/forks","keys_url":"https://api.github.com/repos/jampp/sharedbuffers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jampp/sharedbuffers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jampp/sharedbuffers/teams","hooks_url":"https://api.github.com/repos/jampp/sharedbuffers/hooks","issue_events_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/events{/number}","events_url":"https://api.github.com/repos/jampp/sharedbuffers/events","assignees_url":"https://api.github.com/repos/jampp/sharedbuffers/assignees{/user}","branches_url":"https://api.github.com/repos/jampp/sharedbuffers/branches{/branch}","tags_url":"https://api.github.com/repos/jampp/sharedbuffers/tags","blobs_url":"https://api.github.com/repos/jampp/sharedbuffers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jampp/sharedbuffers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jampp/sharedbuffers/git/refs{/sha}","trees_url":"https://api.github.com/repos/jampp/sharedbuffers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jampp/sharedbuffers/statuses/{sha}","languages_url":"https://api.github.com/repos/jampp/sharedbuffers/languages","stargazers_url":"https://api.github.com/repos/jampp/sharedbuffers/stargazers","contributors_url":"https://api.github.com/repos/jampp/sharedbuffers/contributors","subscribers_url":"https://api.github.com/repos/jampp/sharedbuffers/subscribers","subscription_url":"https://api.github.com/repos/jampp/sharedbuffers/subscription","commits_url":"https://api.github.com/repos/jampp/sharedbuffers/commits{/sha}","git_commits_url":"https://api.github.com/repos/jampp/sharedbuffers/git/commits{/sha}","comments_url":"https://api.github.com/repos/jampp/sharedbuffers/comments{/number}","issue_comment_url":"https://api.github.com/repos/jampp/sharedbuffers/issues/comments{/number}","contents_url":"https://api.github.com/repos/jampp/sharedbuffers/contents/{+path}","compare_url":"https://api.github.com/repos/jampp/sharedbuffers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jampp/sharedbuffers/merges","archive_url":"https://api.github.com/repos/jampp/sharedbuffers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jampp/sharedbuffers/downloads","issues_url":"https://api.github.com/repos/jampp/sharedbuffers/issues{/number}","pulls_url":"https://api.github.com/repos/jampp/sharedbuffers/pulls{/number}","milestones_url":"https://api.github.com/repos/jampp/sharedbuffers/milestones{/number}","notifications_url":"https://api.github.com/repos/jampp/sharedbuffers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jampp/sharedbuffers/labels{/name}","releases_url":"https://api.github.com/repos/jampp/sharedbuffers/releases{/id}","deployments_url":"https://api.github.com/repos/jampp/sharedbuffers/deployments","created_at":"2016-10-04T22:26:03Z","updated_at":"2018-11-15T14:26:53Z","pushed_at":"2018-11-15T15:04:33Z","git_url":"git://github.com/jampp/sharedbuffers.git","ssh_url":"git@github.com:jampp/sharedbuffers.git","clone_url":"https://github.com/jampp/sharedbuffers.git","svn_url":"https://github.com/jampp/sharedbuffers","homepage":null,"size":574,"stargazers_count":10,"watchers_count":10,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":7,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59"},"html":{"href":"https://github.com/jampp/sharedbuffers/pull/59"},"issue":{"href":"https://api.github.com/repos/jampp/sharedbuffers/issues/59"},"comments":{"href":"https://api.github.com/repos/jampp/sharedbuffers/issues/59/comments"},"review_comments":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59/comments"},"review_comment":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jampp/sharedbuffers/pulls/59/commits"},"statuses":{"href":"https://api.github.com/repos/jampp/sharedbuffers/statuses/81f62d3b069d0a3dfdbfa7d9959ff590ae2ac552"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"klaussfreire"}}