{"action":"created","issue":{"url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/16","labels_url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/16/comments","events_url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/16/events","html_url":"https://github.com/stefankoegl/python-json-pointer/pull/16","id":57743967,"number":16,"title":"More efficient resolving","user":{"login":"alexsdutton","id":238690,"avatar_url":"https://avatars.githubusercontent.com/u/238690?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsdutton","html_url":"https://github.com/alexsdutton","followers_url":"https://api.github.com/users/alexsdutton/followers","following_url":"https://api.github.com/users/alexsdutton/following{/other_user}","gists_url":"https://api.github.com/users/alexsdutton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsdutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsdutton/subscriptions","organizations_url":"https://api.github.com/users/alexsdutton/orgs","repos_url":"https://api.github.com/users/alexsdutton/repos","events_url":"https://api.github.com/users/alexsdutton/events{/privacy}","received_events_url":"https://api.github.com/users/alexsdutton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-02-15T20:13:53Z","updated_at":"2015-02-19T22:00:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stefankoegl/python-json-pointer/pulls/16","html_url":"https://github.com/stefankoegl/python-json-pointer/pull/16","diff_url":"https://github.com/stefankoegl/python-json-pointer/pull/16.diff","patch_url":"https://github.com/stefankoegl/python-json-pointer/pull/16.patch"},"body":"I was profiling some of my code which used `jsonpointer`, and I noticed that resolving pointers could be made faster.\r\n\r\nMy profiling script is at https://gist.github.com/alexsdutton/bb95e47a381d0e250fd3/988feaa0e8968893287df01c87eb233c9b86a010. Running on af04ec0, we get the following times on my laptop (Macbook Air, Fedora, Python 2.7.8):\r\n\r\n    3.43161201477 (/a/b/c/d/e/f)\r\n    8.24996113777 (/b/1/1/1/1/1)\r\n    7.04101395607 (/c/1/d/1/e/1/f)\r\n    1.00753712654 (/-)\r\n\r\nAfter each commit we get, respectively:\r\n\r\n    2.40125393867\r\n    5.88285589218\r\n    4.9583530426\r\n    1.05458307266\r\n\r\n    3.08297109604\r\n    4.70882201195\r\n    4.62245106697\r\n    1.13339781761\r\n\r\n    1.59154200554\r\n    3.8058848381\r\n    3.40330195427\r\n    0.9848549366\r\n\r\nSo, about a 2x speed-up on the original code."},"comment":{"url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/comments/75147467","html_url":"https://github.com/stefankoegl/python-json-pointer/pull/16#issuecomment-75147467","issue_url":"https://api.github.com/repos/stefankoegl/python-json-pointer/issues/16","id":75147467,"user":{"login":"alexsdutton","id":238690,"avatar_url":"https://avatars.githubusercontent.com/u/238690?v=3","gravatar_id":"","url":"https://api.github.com/users/alexsdutton","html_url":"https://github.com/alexsdutton","followers_url":"https://api.github.com/users/alexsdutton/followers","following_url":"https://api.github.com/users/alexsdutton/following{/other_user}","gists_url":"https://api.github.com/users/alexsdutton/gists{/gist_id}","starred_url":"https://api.github.com/users/alexsdutton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexsdutton/subscriptions","organizations_url":"https://api.github.com/users/alexsdutton/orgs","repos_url":"https://api.github.com/users/alexsdutton/repos","events_url":"https://api.github.com/users/alexsdutton/events{/privacy}","received_events_url":"https://api.github.com/users/alexsdutton/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T22:00:14Z","updated_at":"2015-02-19T22:00:14Z","body":"@kxepal that gives:\r\n\r\n    1.53566789627\r\n    3.51046395302\r\n    3.03776717186\r\n    0.941489219666\r\n\r\nI can play with Cython to see how that fares, but presumably that would lead to two codebases (i.e. you'd still need the pure Python implementation for non-CPython environments)?"}}