{"action":"created","issue":{"url":"https://api.github.com/repos/pytoolz/toolz/issues/425","repository_url":"https://api.github.com/repos/pytoolz/toolz","labels_url":"https://api.github.com/repos/pytoolz/toolz/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/pytoolz/toolz/issues/425/comments","events_url":"https://api.github.com/repos/pytoolz/toolz/issues/425/events","html_url":"https://github.com/pytoolz/toolz/pull/425","id":371717205,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0MTAyMDU1","number":425,"title":"Faster dissoc","user":{"login":"groutr","id":10678620,"node_id":"MDQ6VXNlcjEwNjc4NjIw","avatar_url":"https://avatars1.githubusercontent.com/u/10678620?v=4","gravatar_id":"","url":"https://api.github.com/users/groutr","html_url":"https://github.com/groutr","followers_url":"https://api.github.com/users/groutr/followers","following_url":"https://api.github.com/users/groutr/following{/other_user}","gists_url":"https://api.github.com/users/groutr/gists{/gist_id}","starred_url":"https://api.github.com/users/groutr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groutr/subscriptions","organizations_url":"https://api.github.com/users/groutr/orgs","repos_url":"https://api.github.com/users/groutr/repos","events_url":"https://api.github.com/users/groutr/events{/privacy}","received_events_url":"https://api.github.com/users/groutr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-18T21:17:03Z","updated_at":"2018-12-06T06:05:51Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/pytoolz/toolz/pulls/425","html_url":"https://github.com/pytoolz/toolz/pull/425","diff_url":"https://github.com/pytoolz/toolz/pull/425.diff","patch_url":"https://github.com/pytoolz/toolz/pull/425.patch"},"body":"Dissoc was really fast when the keys to remove were relatively few\r\ncompared to the size of the dictionary.  This version will pick the smaller\r\ncontainer to iterate over, either building up a new dictionary or tearing\r\ndown a copy.\r\n\r\nA small heuristic is used to decide if the overhead of building a set is\r\nworth the effort.  My rudimentry testing shows that if the number of keys is\r\nless than 60% the length of the dictionary, tearing down a copy is faster.\r\nIf keys is very large, we calculate the difference between mapping and keys \r\nand build a new dictionary out of that difference.\r\n\r\nThis PR trys to change the signature of `dissoc` in a backwards compatible way by adding the `factory` keyword argument.  This makes the function consistent with the call signatures of all the other functions that mutate mappings.  This change was required  otherwise, we'd be unable to initialize a new empty mapping from a factory.  If this is undesirable, we can resort to using `d.__class__()` as the factory.\r\n\r\nMicrobenchmarks coming soon...\r\n\r\nDo you have any feedback, @eriknw?"},"comment":{"url":"https://api.github.com/repos/pytoolz/toolz/issues/comments/444759122","html_url":"https://github.com/pytoolz/toolz/pull/425#issuecomment-444759122","issue_url":"https://api.github.com/repos/pytoolz/toolz/issues/425","id":444759122,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDc1OTEyMg==","user":{"login":"groutr","id":10678620,"node_id":"MDQ6VXNlcjEwNjc4NjIw","avatar_url":"https://avatars1.githubusercontent.com/u/10678620?v=4","gravatar_id":"","url":"https://api.github.com/users/groutr","html_url":"https://github.com/groutr","followers_url":"https://api.github.com/users/groutr/followers","following_url":"https://api.github.com/users/groutr/following{/other_user}","gists_url":"https://api.github.com/users/groutr/gists{/gist_id}","starred_url":"https://api.github.com/users/groutr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/groutr/subscriptions","organizations_url":"https://api.github.com/users/groutr/orgs","repos_url":"https://api.github.com/users/groutr/repos","events_url":"https://api.github.com/users/groutr/events{/privacy}","received_events_url":"https://api.github.com/users/groutr/received_events","type":"User","site_admin":false},"created_at":"2018-12-06T06:05:51Z","updated_at":"2018-12-06T06:05:51Z","author_association":"CONTRIBUTOR","body":"ping @eriknw.  This is ready for review."}}
{"actor":{"display_login":"groutr"}}