{"action":"created","issue":{"url":"https://api.github.com/repos/Blosc/bloscpack/issues/39","labels_url":"https://api.github.com/repos/Blosc/bloscpack/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/Blosc/bloscpack/issues/39/comments","events_url":"https://api.github.com/repos/Blosc/bloscpack/issues/39/events","html_url":"https://github.com/Blosc/bloscpack/pull/39","id":95467187,"number":39,"title":"Use ast.literal_eval instead of np.safe_eval which is at least 20x slower","user":{"login":"cpcloud","id":417981,"avatar_url":"https://avatars.githubusercontent.com/u/417981?v=3","gravatar_id":"","url":"https://api.github.com/users/cpcloud","html_url":"https://github.com/cpcloud","followers_url":"https://api.github.com/users/cpcloud/followers","following_url":"https://api.github.com/users/cpcloud/following{/other_user}","gists_url":"https://api.github.com/users/cpcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/cpcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpcloud/subscriptions","organizations_url":"https://api.github.com/users/cpcloud/orgs","repos_url":"https://api.github.com/users/cpcloud/repos","events_url":"https://api.github.com/users/cpcloud/events{/privacy}","received_events_url":"https://api.github.com/users/cpcloud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-07-16T16:01:43Z","updated_at":"2015-07-16T16:27:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Blosc/bloscpack/pulls/39","html_url":"https://github.com/Blosc/bloscpack/pull/39","diff_url":"https://github.com/Blosc/bloscpack/pull/39.diff","patch_url":"https://github.com/Blosc/bloscpack/pull/39.patch"},"body":"Python 3: ~78x speedup\r\n\r\n```python\r\nIn [5]: import ast, numpy as np\r\n\r\nIn [6]: timeit ast.literal_eval('1')\r\nThe slowest run took 4.03 times longer than the fastest. This could mean that an intermediate result is being cached\r\n100000 loops, best of 3: 4.43 µs per loop\r\n\r\nIn [7]: timeit np.safe_eval('1')\r\n1000 loops, best of 3: 357 µs per loop\r\n```\r\n\r\nPython 2: ~20x speedup\r\n\r\n\r\n```python\r\nIn [1]: import ast, numpy as np\r\n\r\nIn [2]: timeit ast.literal_eval('1')\r\nThe slowest run took 5.84 times longer than the fastest. This could mean that an intermediate result is being cached\r\n100000 loops, best of 3: 4.29 µs per loop\r\n\r\nIn [3]: timeit np.safe_eval('1')\r\nThe slowest run took 58.04 times longer than the fastest. This could mean that an intermediate result is being cached\r\n10000 loops, best of 3: 75.6 µs per loop\r\n```"},"comment":{"url":"https://api.github.com/repos/Blosc/bloscpack/issues/comments/122010923","html_url":"https://github.com/Blosc/bloscpack/pull/39#issuecomment-122010923","issue_url":"https://api.github.com/repos/Blosc/bloscpack/issues/39","id":122010923,"user":{"login":"esc","id":41563,"avatar_url":"https://avatars.githubusercontent.com/u/41563?v=3","gravatar_id":"","url":"https://api.github.com/users/esc","html_url":"https://github.com/esc","followers_url":"https://api.github.com/users/esc/followers","following_url":"https://api.github.com/users/esc/following{/other_user}","gists_url":"https://api.github.com/users/esc/gists{/gist_id}","starred_url":"https://api.github.com/users/esc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esc/subscriptions","organizations_url":"https://api.github.com/users/esc/orgs","repos_url":"https://api.github.com/users/esc/repos","events_url":"https://api.github.com/users/esc/events{/privacy}","received_events_url":"https://api.github.com/users/esc/received_events","type":"User","site_admin":false},"created_at":"2015-07-16T16:27:16Z","updated_at":"2015-07-16T16:27:16Z","body":"now it's green."}}