{"action":"created","issue":{"url":"https://api.github.com/repos/blaze/blaze/issues/1531","repository_url":"https://api.github.com/repos/blaze/blaze","labels_url":"https://api.github.com/repos/blaze/blaze/issues/1531/labels{/name}","comments_url":"https://api.github.com/repos/blaze/blaze/issues/1531/comments","events_url":"https://api.github.com/repos/blaze/blaze/issues/1531/events","html_url":"https://github.com/blaze/blaze/pull/1531","id":161169652,"number":1531,"title":"Memoize subs.","user":{"login":"skrah","id":16530421,"avatar_url":"https://avatars.githubusercontent.com/u/16530421?v=3","gravatar_id":"","url":"https://api.github.com/users/skrah","html_url":"https://github.com/skrah","followers_url":"https://api.github.com/users/skrah/followers","following_url":"https://api.github.com/users/skrah/following{/other_user}","gists_url":"https://api.github.com/users/skrah/gists{/gist_id}","starred_url":"https://api.github.com/users/skrah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skrah/subscriptions","organizations_url":"https://api.github.com/users/skrah/orgs","repos_url":"https://api.github.com/users/skrah/repos","events_url":"https://api.github.com/users/skrah/events{/privacy}","received_events_url":"https://api.github.com/users/skrah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-20T11:01:41Z","updated_at":"2016-07-06T12:06:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/blaze/blaze/pulls/1531","html_url":"https://github.com/blaze/blaze/pull/1531","diff_url":"https://github.com/blaze/blaze/pull/1531.diff","patch_url":"https://github.com/blaze/blaze/pull/1531.patch"},"body":"\r\nThis patch improves the performance of ```subs()``` for large or more complex trees (see  #1518).\r\n\r\nSimple example (10x speedup):\r\n\r\n```python\r\nfrom blaze.expr.core import subs\r\nimport time\r\n\r\ndef mktree(d):\r\n    if d <= 0:\r\n        return []\r\n    return [1, 2, [mktree(d-1)], [mktree(d-1)]]\r\n\r\nt1 = mktree(16)\r\n\r\nstart = time.time()\r\nt2 = subs(t1, {1: 2})\r\nend = time.time()\r\nprint(end-start)\r\n```\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/blaze/blaze/issues/comments/230752996","html_url":"https://github.com/blaze/blaze/pull/1531#issuecomment-230752996","issue_url":"https://api.github.com/repos/blaze/blaze/issues/1531","id":230752996,"user":{"login":"skrah","id":16530421,"avatar_url":"https://avatars.githubusercontent.com/u/16530421?v=3","gravatar_id":"","url":"https://api.github.com/users/skrah","html_url":"https://github.com/skrah","followers_url":"https://api.github.com/users/skrah/followers","following_url":"https://api.github.com/users/skrah/following{/other_user}","gists_url":"https://api.github.com/users/skrah/gists{/gist_id}","starred_url":"https://api.github.com/users/skrah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skrah/subscriptions","organizations_url":"https://api.github.com/users/skrah/orgs","repos_url":"https://api.github.com/users/skrah/repos","events_url":"https://api.github.com/users/skrah/events{/privacy}","received_events_url":"https://api.github.com/users/skrah/received_events","type":"User","site_admin":false},"created_at":"2016-07-06T12:06:23Z","updated_at":"2016-07-06T12:06:23Z","body":"@kwmsmith Yes, in the first implementation large objects were serialized.  I've pushed a new custom decorator that avoids serializing for the common case.\r\n\r\nThe performance is good: It speeds up the ```tail()``` example from #1518 for the existing ```sort``` by about 80% and for the new ```sort2``` by a huge amount.\r\n\r\nThe overhead for trivial cases should be minimal since the hash is mostly cached.\r\n\r\nStatistics for running the test suite for the paths taken in the decorator:\r\n\r\n    * hashable: 25919\r\n    * pickled: 49\r\n    * unpicklable: 0\r\n    * pickle maxlen: 1048718\r\n\r\nSo large mutable objects are still pickled, however there are very few of them. One additional thing to note is that pickling performance is vastly better in Python 3, even compared to cPickle in Python 2.\r\n\r\n\r\n\r\n  \r\n\r\n\r\n\r\n\r\n\r\n"}}
{"actor":{"display_login":"skrah"}}