{"action":"opened","issue":{"url":"https://api.github.com/repos/CovertLab/arrow/issues/24","repository_url":"https://api.github.com/repos/CovertLab/arrow","labels_url":"https://api.github.com/repos/CovertLab/arrow/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/CovertLab/arrow/issues/24/comments","events_url":"https://api.github.com/repos/CovertLab/arrow/issues/24/events","html_url":"https://github.com/CovertLab/arrow/issues/24","id":393562217,"node_id":"MDU6SXNzdWUzOTM1NjIyMTc=","number":24,"title":"Profiling utilities and routine profiling","user":{"login":"jmason42","id":5050496,"node_id":"MDQ6VXNlcjUwNTA0OTY=","avatar_url":"https://avatars1.githubusercontent.com/u/5050496?v=4","gravatar_id":"","url":"https://api.github.com/users/jmason42","html_url":"https://github.com/jmason42","followers_url":"https://api.github.com/users/jmason42/followers","following_url":"https://api.github.com/users/jmason42/following{/other_user}","gists_url":"https://api.github.com/users/jmason42/gists{/gist_id}","starred_url":"https://api.github.com/users/jmason42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmason42/subscriptions","organizations_url":"https://api.github.com/users/jmason42/orgs","repos_url":"https://api.github.com/users/jmason42/repos","events_url":"https://api.github.com/users/jmason42/events{/privacy}","received_events_url":"https://api.github.com/users/jmason42/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-21T19:10:47Z","updated_at":"2018-12-21T19:10:47Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It's hard to speed up code without proper profiling tools.  Existing solutions that I'm aware of:\r\n- The built in `profile`/`cProfile` modules.  I find these to be cumbersome, particularly because they can track evaluation time for functions that aren't being called or defined in the relevant scope.  Perhaps there is a better way to use these.\r\n- `kernprof.py` AKA the line profiler.  Really terrific as far as isolating and inspecting one scope.  Not great for routine profiling.\r\n- IDE (e.g. PyCharm) profilers.  In my brief stint with PyCharm I was unable to get this tool running; it also is unsuitable for routine profiling.\r\n- Calling `time` via the command line, or other tools like `pytest`.  Only useful for isolated code, and subject to a lot of variability.\r\n- Tools like the `timeit` module.  Again, only useful for isolated code, but does a few things to temper out any evaluation-to-evaluation variability.\r\n\r\nCustom solutions I've used in the past:\r\n- Peppering code with `time.time()` calls to collect the evaluation time associated with blocks of code.  Quick and easy, but potentially ugly and non-specific.\r\n- Writing a decorator that wraps a function and accumulates information about how long it takes to run.  Can be largely transparent.  Requires functionalization of the interesting bits.\r\n\r\nI'm inclined to go with the latter; it will require us to break off more pieces and test them independently, but I think that's healthy anyway.\r\n\r\nAs far as routine profiling goes - I think this is desirable.  I find it to be a useful way to check the health of code, as well as a way to make sure that anticipated performance hits do indeed have the anticipated effect (sanity check).  It's unclear to me where this ought to go.  It can't really be a unit test, since we have no expected run time that is going to be consistent across hardware (and run time is variable regardless)."}}
{"actor":{"display_login":"jmason42"}}