{"action":"opened","issue":{"url":"https://api.github.com/repos/kirnap/algorithms-in-python/issues/2","labels_url":"https://api.github.com/repos/kirnap/algorithms-in-python/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/kirnap/algorithms-in-python/issues/2/comments","events_url":"https://api.github.com/repos/kirnap/algorithms-in-python/issues/2/events","html_url":"https://github.com/kirnap/algorithms-in-python/issues/2","id":106132727,"number":2,"title":"Comments should acknowledge slowness vs. the builtin sorted()","user":{"login":"cclauss","id":3709715,"avatar_url":"https://avatars.githubusercontent.com/u/3709715?v=3","gravatar_id":"","url":"https://api.github.com/users/cclauss","html_url":"https://github.com/cclauss","followers_url":"https://api.github.com/users/cclauss/followers","following_url":"https://api.github.com/users/cclauss/following{/other_user}","gists_url":"https://api.github.com/users/cclauss/gists{/gist_id}","starred_url":"https://api.github.com/users/cclauss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cclauss/subscriptions","organizations_url":"https://api.github.com/users/cclauss/orgs","repos_url":"https://api.github.com/users/cclauss/repos","events_url":"https://api.github.com/users/cclauss/events{/privacy}","received_events_url":"https://api.github.com/users/cclauss/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-12T05:26:39Z","updated_at":"2015-09-12T05:26:39Z","closed_at":null,"body":"Is merge_sort code purely for education purposes or is there a reason to recommend its use instead of [builtins](https://wiki.python.org/moin/HowTo/Sorting) in production programs given its execution speed?  The comments should make this explicit.\r\n\r\n```python\r\nif __name__ == '__main__':\r\n    #print merge_sort([])\r\n    import timeit\r\n    number = 100000\r\n    # 0.75 sec on my iPad\r\n    print(timeit.timeit('sorted([1, 8, 7, 76, 9, 5, 2, 4])', number=number))\r\n    # 13.43 sec on my iPad\r\n    print(timeit.timeit('merge_sort([1, 8, 7, 76, 9, 5, 2, 4])',\r\n            setup='from __main__ import merge_sort', number=number))\r\n```\r\n"}}