{"action":"created","issue":{"url":"https://api.github.com/repos/elm/core/issues/1000","repository_url":"https://api.github.com/repos/elm/core","labels_url":"https://api.github.com/repos/elm/core/issues/1000/labels{/name}","comments_url":"https://api.github.com/repos/elm/core/issues/1000/comments","events_url":"https://api.github.com/repos/elm/core/issues/1000/events","html_url":"https://github.com/elm/core/pull/1000","id":373286853,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MjUxMzEx","number":1000,"title":"Improve overall iteration performance","user":{"login":"austinshenk","id":2991598,"node_id":"MDQ6VXNlcjI5OTE1OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/2991598?v=4","gravatar_id":"","url":"https://api.github.com/users/austinshenk","html_url":"https://github.com/austinshenk","followers_url":"https://api.github.com/users/austinshenk/followers","following_url":"https://api.github.com/users/austinshenk/following{/other_user}","gists_url":"https://api.github.com/users/austinshenk/gists{/gist_id}","starred_url":"https://api.github.com/users/austinshenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinshenk/subscriptions","organizations_url":"https://api.github.com/users/austinshenk/orgs","repos_url":"https://api.github.com/users/austinshenk/repos","events_url":"https://api.github.com/users/austinshenk/events{/privacy}","received_events_url":"https://api.github.com/users/austinshenk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-24T03:13:41Z","updated_at":"2018-10-24T15:10:59Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/elm/core/pulls/1000","html_url":"https://github.com/elm/core/pull/1000","diff_url":"https://github.com/elm/core/pull/1000.diff","patch_url":"https://github.com/elm/core/pull/1000.patch"},"body":"Multiple modules in core loop through list, arrays, and objects in various ways. Some can't be improved like the while cons, but there are a number of them that could be restructured to gain quite a bit of performance for not much, or any, file size increase.\r\n\r\nA performance test bench detailed [here](https://web.archive.org/web/20141205235948/https://blogs.oracle.com/greimer/entry/best_way_to_code_a) shows many cases where a decrementing while loop with a simple conditional is the fastest looping structure.\r\n\r\n```\r\nvar i=arr.length; while (i--) {}\r\n```\r\n\r\nI know this can't always be achieved given the functionality of the loop, but in the worst case we can ensure small improvements. For example, I've found various cases where a for-loop's length could be cached so it is not having to be calculated every iteration. It sounds small, but it even has better performance.\r\n\r\nI'm planning to implement and test many of the areas I've found and report on the results for performance and also verifying functionality was not altered."},"comment":{"url":"https://api.github.com/repos/elm/core/issues/comments/432699615","html_url":"https://github.com/elm/core/pull/1000#issuecomment-432699615","issue_url":"https://api.github.com/repos/elm/core/issues/1000","id":432699615,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjY5OTYxNQ==","user":{"login":"austinshenk","id":2991598,"node_id":"MDQ6VXNlcjI5OTE1OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/2991598?v=4","gravatar_id":"","url":"https://api.github.com/users/austinshenk","html_url":"https://github.com/austinshenk","followers_url":"https://api.github.com/users/austinshenk/followers","following_url":"https://api.github.com/users/austinshenk/following{/other_user}","gists_url":"https://api.github.com/users/austinshenk/gists{/gist_id}","starred_url":"https://api.github.com/users/austinshenk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austinshenk/subscriptions","organizations_url":"https://api.github.com/users/austinshenk/orgs","repos_url":"https://api.github.com/users/austinshenk/repos","events_url":"https://api.github.com/users/austinshenk/events{/privacy}","received_events_url":"https://api.github.com/users/austinshenk/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T15:10:59Z","updated_at":"2018-10-24T15:10:59Z","author_association":"NONE","body":"Did similar testing to `String.map` as I did with reverse. The following screen is the timing results of mapping through a 1 million character string.\r\n\r\n![image](https://user-images.githubusercontent.com/2991598/47441018-5151cf80-d77d-11e8-97bb-8aedce4bc478.png)\r\n\r\nOverall about a 2x increase in performance. I also verified its functionality was not altered."}}
{"actor":{"display_login":"austinshenk"}}